package com.wonders.cyxtjsonupdate.service;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.wonders.cyxtjsonupdate.entity.Cyxt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * @Description:城运页面更新数据生成
 * @ClassName: CyxtJsonData
 * @Author: 陈兆庆
 * @Date: 2021/12/30 14:29
 * @Version: 1.0     // 版本
 */
@Service
public class CyxtJsonData {
    private static final Logger log = LoggerFactory.getLogger(CyxtJsonData.class);
    private Calendar calendar;
    private static Integer year;
    private static Integer month;

    @Autowired
    @Qualifier("primaryJdbcTemplate")
    public JdbcTemplate primaryJdbcTemplate;

    @Autowired
    @Qualifier("secondaryJdbcTemplate")
    public JdbcTemplate secondaryJdbcTemplate;

    @PostConstruct
    public void getCalender() {
        calendar = Calendar.getInstance();
        year = calendar.get(Calendar.YEAR) - 1;
      /*  month = calendar.get(Calendar.MONTH) + 1;*/
        month=11;
    }


    /**
     * Methad info:----全社会货物运输量、百分比
     *
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author 陈兆庆
     * @date 2021/12/30 14:57
     */
    public List<Map<String, Object>> init() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='main_qshhwysl' and YM like" + "'" + year + "%" + "'" + "order by YM";
//        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='main_qshhwysl' order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);

        return maps;
    }

    /**
     * Methad info:----公路货物运输量、百分比
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author 陈兆庆
     * @date 2021/12/30 16:24
     */

    public List<Map<String, Object>> initRoadTransport() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='highway_hwfsl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:----水路货物运输量、百分比
     *
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author 陈兆庆
     * @date 2021/12/30 16:53
     */

    public List<Map<String, Object>> initWaterWayTransport() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='waterway_hwysl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:----铁路货物运输量、百分比
     *
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author 陈兆庆
     * @date 2021/12/30 18:07
     */

    public List<Map<String, Object>> initrailwayTransport() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='railway_hwfsl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:----航空货物运输量、百分比
     *
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author 陈兆庆
     * @date 2021/12/31 11:05
     */

    public List<Map<String, Object>> initairTransport() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='aviation_jchwttl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:-------全港货物吞吐量、同比
     *
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author 陈兆庆
     * @date 2022/1/4 13:56
     */

    public List<Map<String, Object>> initHarborThroughput() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='main_qghwtdl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:---------两个饼图海港累计吞吐量
     *
     * @author 陈兆庆
     * @date 2022/1/4 15:27
     */
    public List<Map<String, Object>> initHarborPieChart() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='port_qghwttl_hg' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }


    /**
     * Methad info:---------两个饼图内河港累计吞吐量
     *
     * @author 陈兆庆
     * @date 2022/1/4 15:27
     */
    public List<Map<String, Object>> initRiverPieChart() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='port_qghwttl_nhg' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:---------两个饼图外贸累计吞吐量
     *
     * @author 陈兆庆
     * @date 2022/1/4 15:27
     */
    public List<Map<String, Object>> initForeignTrade() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='port_qghwttl_wm' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:---------两个饼图内贸累计吞吐量
     *
     * @author 陈兆庆
     * @date 2022/1/4 15:27
     */
    public List<Map<String, Object>> initDomesticTrade() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='port_qghwttl_nm' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:---------集装箱吞吐量
     *
     * @author 陈兆庆
     * @date 2022/1/4 15:27
     */
    public List<Map<String, Object>> initcontainer() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='port_jzxttl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:---------集装箱吞吐量洋山深水港区
     *
     * @author 陈兆庆
     * @date 2022/1/4 15:27
     */
    public List<Map<String, Object>> initcontainerysssgq() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='port_jzxttl_ysssgq' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:-----------对外旅客发送量(人次) 、同比
     *
     * @author 陈兆庆
     * @date 2022/1/5 15:52
     */
    public List<Map<String, Object>> initTraveler() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='main_dwlkfsl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:----------- 公路旅客发送量(人次) 、同比
     *
     * @author 陈兆庆
     * @date 2022/1/5 16:28
     */
    public List<Map<String, Object>> initHighway() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='main_dwlkfsl_gl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:-----水路旅客发送量(人次) 、同比
     *
     * @author 陈兆庆
     * @date 2022/1/5 16:38
     */
    public List<Map<String, Object>> initWaterway() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='main_dwlkfsl_sl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }


    /**
     * Methad info:-----铁路旅客发送量(人次) 、同比
     *
     * @author 陈兆庆
     * @date 2022/1/5 16:45
     */
    public List<Map<String, Object>> initrailway() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='main_dwlkfsl_tl' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:-----航空旅客发送量(人次) 、同比
     *
     * @author 陈兆庆
     * @date 2022/1/5 16:52
     */
    public List<Map<String, Object>> initaviation() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='main_dwlkfsl_hk' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:虹桥机场吞吐量
     *
     * @author 陈兆庆
     * @date 2022/1/6 14:32
     */

    public List<Map<String, Object>> initHongQiaoAirport() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='aviation_jclkttl_hqjc' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }


    /**
     * Methad info:虹桥机场吞吐量
     *
     * @author 陈兆庆
     * @date 2022/1/6 14:36
     */
    public List<Map<String, Object>> initPudongAirport() {
        String sql = "select * from T_TRAFFIC_STATISTICS@DW where indicatorType ='aviation_jclkttl_pdjc' and YM like" + "'" + year + "%" + "'" + "order by YM";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:---巡游车每车日均订单（单）
     *
     * @author 陈兆庆
     * @date 2022/1/6 17:05
     */
    public Object initCarAvg() {

        String sql = "select count(1)/count(distinct ch) from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')";
       /* String sql = "select count(1)/count(distinct ch) from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-03','yyyy-MM-dd')";*/
        Object objects = primaryJdbcTemplate.queryForObject(sql, String.class);
        return objects;
    }

    /**
     * Methad info:--巡游车每单载客里程（公里）
     *
     * @author 陈兆庆
     * @date 2022/1/7 10:11
     */
    public Object initSingleData() {

        String sql = "select sum(JC)/10/count(1) from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and JC<1000";
      /*  String sql = "select sum(JC)/10/count(1) from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-03','yyyy-MM-dd') and JC<1000";*/
        Object objects = primaryJdbcTemplate.queryForObject(sql, String.class);
        return objects;
    }

    /**
     * Methad info:--巡游车每单载客时长（分）
     *
     * @author 陈兆庆
     * @date 2022/1/7 10:34
     */
    public Object initPassengerTimeFororder() {

        String sql = "select sum(f_get_zksj(scsj,xcsj,0))/count(1) from (select * from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')and (to_number(xcsj)-to_number(scsj))>0)";
   /*     String sql = "select sum(f_get_zksj(scsj,xcsj,0))/count(1) from (\n" +
                "select * from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-03','yyyy-MM-dd')  and (to_number(xcsj)-to_number(scsj))>0)";*/
        Object objects = primaryJdbcTemplate.queryForObject(sql, String.class);
        return objects;
    }

    /**
     * Methad info:巡游车统计每辆车的总里程（角）
     *
     * @author 陈兆庆
     * @date 2022/1/6 18:51
     */
    public List<Map<String, Object>> initTotalMoney() {

        String sql = "SELECT CH, SUM(CCJE) from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') GROUP BY CH";
       /* String sql = "SELECT CH, SUM(CCJE) from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-02','yyyy-MM-dd')\n" +
                "and SCRQ<to_date('2021-11-03','yyyy-MM-dd') GROUP BY CH";*/
        List<Map<String, Object>> maps = primaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info: 巡游车每单营收
     *
     * @author 陈兆庆
     * @date 2022/1/7 10:53
     */
    public Object initMoneyForOrder() {

        String sql = "select sum(CCJE)/10/count(1) from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')";
       /* String sql = "select sum(CCJE)/10/count(1) from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-03','yyyy-MM-dd')";*/
        Object objects = primaryJdbcTemplate.queryForObject(sql, String.class);
        return objects;
    }

    /**
     * Methad info:--巡游车每车日均载客里程（公里）
     *
     * @author 陈兆庆
     * @date 2022/1/7 10:56
     */
    public Object initKiloMeterForCarryPassengers() {

        String sql = "select sum(f_get_zksj(scsj,xcsj,0))/count(distinct ch) from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and JS!=0";
     /*   String sql = "select sum(f_get_zksj(scsj,xcsj,0))/count(distinct ch) from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-03','yyyy-MM-dd')  and JS!=0";*/
        Object objects = primaryJdbcTemplate.queryForObject(sql, String.class);
        return objects;
    }


    /**
     * Methad info:巡游车每笔订单营收分布
     *
     * @author 陈兆庆
     * @date 2022/1/10 10:00
     */
    public List<Map<String, Object>> initRevenueDistributionOforder() {

       /* String sql = "(\n" +
                "select '150' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and CCJE<=150\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(select '150300' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and CCJE>150 and CCJE<=300\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '300500' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and CCJE>300 and CCJE<=500\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '5001000' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and CCJE>500 and CCJE<=1000\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '1000' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and CCJE>1000\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))";*/
        String sql = "(\n" +
                "select '150' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and CCJE<=150 " +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(select '150300' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and CCJE>150 and CCJE<=300\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                "))\n" +
                "union\n" +
                "(select '300500' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and CCJE>300 and CCJE<=500\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                "))\n" +
                "union\n" +
                "(select '5001000' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and CCJE>500 and CCJE<=1000\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                "))\n" +
                "union\n" +
                "(select '1000' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and CCJE>1000\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                "))";
        List<Map<String, Object>> maps = primaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:--【巡游车】每车日均营收分布
     *
     * @author 陈兆庆
     * @date 2022/1/10 11:05
     */
    public List<Map<String, Object>> initDistributionOfCar() {

/*        String sql = "(\n" +
                "select '100' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1) a  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') group by t.ch\n" +
                ") where s<=100\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1) b  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') group by t.ch\n" +
                ")\n" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(\n" +
                "select '100200' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1) a  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') group by t.ch\n" +
                ") where s>=100 and s<200\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1) b  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') group by t.ch\n" +
                ")\n" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(\n" +
                "select '200500' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1) a  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') group by t.ch\n" +
                ") where s>=200 and s<500\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1) b  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') group by t.ch\n" +
                ")\n" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(\n" +
                "select '5001000' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1) a  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') group by t.ch\n" +
                ") where s>=500 and s<1000\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1) b  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') group by t.ch\n" +
                ")\n" +
                ")\n" +
                ")\n";*/
        String sql = "(\n" +
                "select '100' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1) a  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') group by t.ch\n" +
                ") where s<=100\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1) b  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') group by t.ch\n" +
                ")\n" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(\n" +
                "select '100200' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1) a  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') group by t.ch\n" +
                ") where s>=100 and s<200\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1) b  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') group by t.ch\n" +
                ")\n" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(\n" +
                "select '200500' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1) a  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') group by t.ch\n" +
                ") where s>=200 and s<500\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1) b  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') group by t.ch\n" +
                ")\n" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(\n" +
                "select '5001000' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1) a  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') group by t.ch\n" +
                ") where s>=500 and s<1000\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1) b  from (\n" +
                "select ch,sum(CCJE)/10 s from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') group by t.ch\n" +
                ")\n" +
                ")\n" +
                ")\n";
        List<Map<String, Object>> maps = primaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info:日均乘距分布(公里)
     *
     * @author 陈兆庆
     * @date 2022/1/10 11:34
     */
    public List<Map<String, Object>> initDistributionOfDistance() {

       /* String sql = "(\n" +
                "select '3' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=0 and jc<30\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(select '35' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=30 and jc<50\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '57' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=50 and jc<70\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '710' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=70 and jc<100\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '1015' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=100 and jc<150\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '1520' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=150 and jc<200\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '2030' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=200 and jc<300\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '3040' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=300 and jc<400\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '4070' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=400 and jc<700\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))\n" +
                "union\n" +
                "(select '70' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd') and jc>=700\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-01','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-02','yyyy-MM-dd')\n" +
                "))";*/
        String sql = "(\n" +
                "select '3' type, a/b v from\n" +
                "(\n" +
                "\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=0 and jc<30\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                ")\n" +
                ")\n" +
                "union\n" +
                "(select '35' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=30 and jc<50\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                "))\n" +
                "union\n" +
                "(select '57' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=50 and jc<70\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                "))\n" +
                "union\n" +
                "(select '710' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=70 and jc<100\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                "))\n" +
                "union\n" +
                "(select '1015' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=100 and jc<150\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                "))\n" +
                "union\n" +
                "(select '1520' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=150 and jc<200\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')"+
                "))\n" +
                "union\n" +
                "(select '2030' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=200 and jc<300\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')"+
                "))\n" +
                "union\n" +
                "(select '3040' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=300 and jc<400\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')"+
                "))\n" +
                "union\n" +
                "(select '4070' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=400 and jc<700\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')"+
                "))\n" +
                "union\n" +
                "(select '70' type, a/b v from\n" +
                "(\n" +
                "select 100*count(1)a  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and jc>=700\n" +
                ")\n" +
                ",\n" +
                "(\n" +
                "select count(1)b  from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')" +
                "))";
        List<Map<String, Object>> maps = primaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    /**
     * Methad info://出租车客运量
     *
     * @author 陈兆庆
     * @date 2022/1/10 12:42
     */
    public Object buildtaxi() {

        String sql = "select MONTHSUM from T_TRAFFIC_STATISTICS@Dw where indicatorType ='taxi_kyl' and YM like" + "'" +year + "-" + month +"'";
        Object objects = secondaryJdbcTemplate.queryForObject(sql, String.class);
        return objects;
    }


    /**
     * Methad info:巡游车企业日均订单TOP10
     *
     * @author 陈兆庆
     * @date 2022/1/10 12:58
     */

    public List<Map<String, Object>> initTaxiTopTen() {

       /* String sql = "select th.yhmc,a.c||'%' from (\n" +
                "select qybm,round(100*count(1)/280179,2) c from W_CZ_JS007_03 t where SCRQ>=to_date('2021-11-20','yyyy-MM-dd') \n" +
                "and SCRQ<to_date('2021-11-21','yyyy-MM-dd') group by t.qybm) a,T_CZ_YHMC th \n" +
                "where th.yhbm=a.qybm order by c desc ";*/
        String sql = "select th.yhmc,a.c||'%' from (\n" +
                "select qybm,round(100*count(1)/280179,2) c from W_CZ_JS007_03 t where SCRQ>=to_date" + "(" + "'" + year + "-" + month + "-20'" + "," + "'yyyy-MM-dd')" + " and SCRQ<to_date(" + "'" + year + "-" + month + "-21'" + "," + "'yyyy-MM-dd') group by t.qybm) a,T_CZ_YHMC th \n" +
                "where th.yhbm=a.qybm order by c desc ";
        List<Map<String, Object>> maps = primaryJdbcTemplate.queryForList(sql);
        return maps;
    }


    /**
     * Methad info: 网约车每车日均订单（单）
     *
     * @author 陈兆庆
     * @date 2022/1/10 15:06
     */
    public Object buildNetcarOrder() {

    /*    String sql = "select count(1)/count(distinct VEHICLENO) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and DESTTIME<to_date('2021-11-03','yyyy-MM-dd')";*/
        String sql = "select count(1)/count(distinct VEHICLENO) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and DESTTIME<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')";
        Object s = secondaryJdbcTemplate.queryForObject(sql, String.class);
        return s;
    }


    /**
     * Methad info:网约车--每单载客里程
     *
     * @author 陈兆庆
     * @date 2022/1/10 15:14
     */
    public Object buildNetcarOrderOfdis() {

       /* String sql = "select sum(DRIVEMILE)/count(1) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and DESTTIME<to_date('2021-11-03','yyyy-MM-dd') and DRIVEMILE<400";*/
          String sql = "select sum(DRIVEMILE)/count(1) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and DESTTIME<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and DRIVEMILE<400";
        Object s = secondaryJdbcTemplate.queryForObject(sql, String.class);
        return s;
    }

    /**
     * Methad info:--每单载客时长（分）
     *
     * @author 陈兆庆
     * @date 2022/1/10 15:18
     */
    public Object buildNetcarOrderOfTime() {

       /* String sql = "select sum(DRIVETIME)/60/count(1) from (\n" +
                "select * from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and DESTTIME<to_date('2021-11-03','yyyy-MM-dd'))";*/
        String sql = "select sum(DRIVETIME)/60/count(1) from (\n" +
                "select * from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and DESTTIME<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd'))";
        Object s = secondaryJdbcTemplate.queryForObject(sql, String.class);
        return s;
    }

    /**
     * Methad info:--每单营收（元）
     *
     * @author 陈兆庆
     * @date 2022/1/10 15:22
     */
    public Object buildNetcarOrderOfRich() {

       /* String sql = "select sum(PRICE)/count(1) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and DESTTIME<to_date('2021-11-03','yyyy-MM-dd')";*/
        String sql = "select sum(PRICE)/count(1) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and DESTTIME<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')";
        Object s = secondaryJdbcTemplate.queryForObject(sql, String.class);
        return s;
    }

    /**
     * Methad info:--每车日均载客里程（公里）
     *
     * @author 陈兆庆
     * @date 2022/1/10 15:25
     */
    public Object buildNetcardisOfDay() {

        /*String sql = "select sum(DRIVEMILE)/count(distinct VEHICLENO) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and DESTTIME<to_date('2021-11-03','yyyy-MM-dd') and DRIVEMILE<400";*/
        String sql = "select sum(DRIVEMILE)/count(distinct VEHICLENO) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and DESTTIME<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd') and DRIVEMILE<400";
        Object s = secondaryJdbcTemplate.queryForObject(sql, String.class);
        return s;
    }

    /**
     * Methad info:--每车日均载客时长（分)
     *
     * @author 陈兆庆
     * @date 2022/1/10 15:28
     */
    public Object buildNetcarWorktime() {

      /*  String sql = "select sum(DRIVETIME)/60/count(distinct VEHICLENO) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date('2021-11-02','yyyy-MM-dd') \n" +
                "and DESTTIME<to_date('2021-11-03','yyyy-MM-dd')  and DRIVETIME!=0";*/
        String sql = "select sum(DRIVETIME)/60/count(distinct VEHICLENO) from t_sup_tc_order_pay@netcar20 t where DESTTIME>=to_date" + "(" + "'" + year + "-" + month + "-02'" + "," + "'yyyy-MM-dd')" + " and DESTTIME<to_date(" + "'" + year + "-" + month + "-03'" + "," + "'yyyy-MM-dd')  and DRIVETIME!=0";
        Object s = secondaryJdbcTemplate.queryForObject(sql, String.class);
        return s;
    }


    /**
     * Methad info:-------订单日均分布
     *
     * @author 陈兆庆
     * @date 2022/1/10 15:40
     */
    public List<Map<String, Object>> initDistributionOfOrders() {

      /*  String sql = "select * from (\n" +
                "select companyid,count(1)/10 c from T_SUP_TC_ORDER_PAY@netcar20 t where DESTTIME>=to_date('2021-11-21','yyyy-MM-dd')\n" +
                "and DESTTIME<to_date('2021-11-22','yyyy-MM-dd') group by companyid\n" +
                ") order by c desc";*/
        String sql = "select * from (\n" +
                "select companyid,count(1)/10 c from T_SUP_TC_ORDER_PAY@netcar20 t where DESTTIME>=to_date" + "(" + "'" + year + "-" + month + "-21'" + "," + "'yyyy-MM-dd')" + " and DESTTIME<to_date(" + "'" + year + "-" + month + "-22'" + "," + "'yyyy-MM-dd') group by companyid\n" +
                ") order by c desc";
        List<Map<String, Object>> maps = secondaryJdbcTemplate.queryForList(sql);
        return maps;
    }

    //以上是初始化数据
    //build货运数据
    public List<String> buildFreightData() {
        ArrayList<String> list = new ArrayList<>();//用来存储所有的最终的json
        Calendar cal = Calendar.getInstance();
        NumberFormat nf = NumberFormat.getInstance();
        nf.setMaximumFractionDigits(0);//保留0位

        //初始化全社会货物运输量
        List<Map<String, Object>> init = init();
        //初始化公路货物运输量
        List<Map<String, Object>> roadTransportList = initRoadTransport();
        //初始化水路货物运输量
        List<Map<String, Object>> waterWayList = initWaterWayTransport();
        //初始化铁路货物运输量
        List<Map<String, Object>> railwayList = initrailwayTransport();
        //初始化航空货物运输量
        List<Map<String, Object>> airList = initairTransport();
        //初始化全港货物吞吐量
        List<Map<String, Object>> harborList = initHarborThroughput();
        //初始化两个饼图海港累计吞吐量
        List<Map<String, Object>> seaborList = initHarborPieChart();
        //初始化两个饼图内河港累计吞吐量
        List<Map<String, Object>> harborRiverList = initRiverPieChart();
        //初始化两个饼图外贸累计吞吐量
        List<Map<String, Object>> foreignTradeList = initForeignTrade();
        //初始化两个饼图内贸累计吞吐量
        List<Map<String, Object>> domesticTradeList = initDomesticTrade();
        //初始化集装箱吞吐量
        List<Map<String, Object>> containerList = initcontainer();
        //初始化洋山深水港区完成量
        List<Map<String, Object>> ssgqList = initcontainerysssgq();


        //获得当前月份
        int month = cal.get(Calendar.MONTH) + 1;
        month = 11;//因目前1月份数据库未产生12月份数据，此此先模拟
        //获得当前年份
        int year = cal.get(Calendar.YEAR);
        //----全社会货物运输量、百分比的Map
        Cyxt cyxt1 = buildgeneralpParame("40a573341be84eb9af601d359da70947", "hyLazy", "yqshhwysl");
        Map<String, Object> stringObjectMap = init.get(month - 1);
        //月均
        buildfreightMonthAverage(cyxt1, month, stringObjectMap, list, nf);

        //同比增长
        Cyxt cyxt2 = buildgeneralpParame("faf1139827b24c7ea576582a1255daaf", "hyLazy", "yqshhwyslbfb");
        buildfreightYearGrowth(cyxt2, stringObjectMap, list);

        //--累计（yearSum）
        Cyxt cyxt3 = buildgeneralpParame("93c6065815514ec7bac1bf936193a853", "hyLazy", "bqshhwysl");
        buildfreightYeartotal(cyxt3, stringObjectMap, list, nf);

        //-- 同比增量（BNBSNTQZJB字段）
        Cyxt cyxt4 = buildgeneralpParame("5a819d0ff78e4603a3cc5b92c3c2b8b5", "hyLazy", "bqshhwyslbfb");
        buildfreightYeartoYeartotal(cyxt4, stringObjectMap, list);


        //----公路货物运输量、百分比的Map
        Map<String, Object> roadMap = roadTransportList.get(month - 1);
        Cyxt cyxt5 = buildgeneralpParame("a26c97630ab24cf988a1c0fbb2f57b04", "hyLazy", "yglhwysl");
        //月均
        buildfreightMonthAverage(cyxt5, month, roadMap, list, nf);

        //同比增长
        Cyxt cyxt6 = buildgeneralpParame("febb46d9943d42dbb4cbb5efb9258dc2", "hyLazy", "yglhwyslbfb");
        buildfreightYearGrowth(cyxt6, roadMap, list);

        //累计
        Cyxt cyxt7 = buildgeneralpParame("ed4eca7dd3db4b349d61a1e26fbd6765", "hyLazy", "bglhwysl");
        buildfreightYeartotal(cyxt7, roadMap, list, nf);

        //-- 同比增量（BNBSNTQZJB字段）
        Cyxt cyxt8 = buildgeneralpParame("ab6395b4c58044c18eb23c2b98f0ea29", "hyLazy", "bglhwyslbfb");
        buildfreightYeartoYeartotal(cyxt8, roadMap, list);

        //----水路货物运输量、百分比的Map
        Map<String, Object> waterMap = waterWayList.get(month - 1);
        Cyxt cyxt9 = buildgeneralpParame("a605d3a5a4384453b78db1522e0fae44", "hyLazy", "yslhwysl");
        //--月均
        buildfreightMonthAverage(cyxt9, month, waterMap, list, nf);

        //同比增长
        Cyxt cyxt10 = buildgeneralpParame("dda8e840e5024ac28b80125484c689a6", "hyLazy", "yslhwyslbfb");
        buildfreightYearGrowth(cyxt10, waterMap, list);

        //--累计
        Cyxt cyxt11 = buildgeneralpParame("93c6065815514ec7bac1bf936193a853", "hyLazy", "bqshhwysl");
        buildfreightYeartotal(cyxt11, waterMap, list, nf);

        //-- 同比增量（BNBSNTQZJB字段）
        Cyxt cyxt12 = buildgeneralpParame("ab6395b4c58044c18eb23c2b98f0ea29", "hyLazy", "bglhwyslbfb");
        buildfreightYeartoYeartotal(cyxt12, waterMap, list);

        //----铁路货物运输量、百分比的Map
        Map<String, Object> railwayMap = railwayList.get(month - 1);
        //--月均
        Cyxt cyxt13 = buildgeneralpParame("676408728cc643dbb03f84502348e76d", "hyLazy", "ytlhwysl");
        buildfreightMonthAverage(cyxt13, month, railwayMap, list, nf);

        //同比增长
        Cyxt cyxt14 = buildgeneralpParame("4846a35d3c704f48b3e0f8e358507270", "hyLazy", "ytlhwyslbfb");
        buildfreightYearGrowth(cyxt14, railwayMap, list);

        //--累计
        Cyxt cyxt15 = buildgeneralpParame("93c6065815514ec7bac1bf936193a853", "hyLazy", "bqshhwysl");
        buildfreightYeartotal(cyxt15, railwayMap, list, nf);

        //-- 同比增量（BNBSNTQZJB字段）
        Cyxt cyxt16 = buildgeneralpParame("a7e65588e92e4889b3fc4c97523ca092", "hyLazy", "btlhwyslbfb");
        buildfreightYearGrowth(cyxt16, railwayMap, list);

        //----航空货物运输量、百分比的Map
        Map<String, Object> airMap = airList.get(month - 1);
        //--月均
        Cyxt cyxt17 = buildgeneralpParame("8083d8da97364cc4853ae540bd940c39", "hyLazy", "yjchwttl");
        buildfreightMonthAverage(cyxt17, month, airMap, list, nf);

        //--同比增量（字段BNBSNTQZJB）
        Cyxt cyxt18 = buildgeneralpParame("b62c482499704c3b9cf3bdbd24740734", "hyLazy", "yjchwttlbfb");
        buildfreightYearGrowth(cyxt18, airMap, list);

        //--累计

        Cyxt cyxt19 = buildgeneralpParame("868c4b8e1abb4614aaeecc144e4e7d3d", "hyLazy", "bjchwttl");
        buildfreightYeartotal(cyxt19, airMap, list, nf);

        //-- 同比增量（BNBSNTQZJB字段）
        Cyxt cyxt20 = buildgeneralpParame("fdc9d3d8497d4eb0aac6708f6b9c8aca", "hyLazy", "bjchwttlbfb");
        buildfreightYearGrowth(cyxt20, airMap, list);

        //-----货物运输量月分布
        Cyxt cyxt21 = buildgeneralpParame("9ff99ab83aae4bf58c67af3023f3aec7", "hyLazy", "myChart1");
        ArrayList<List<Integer>> dataList = new ArrayList<>();
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < month; j++) {
                if (i == 0) {
                    ArrayList<Integer> allfreightList = new ArrayList<>();
                    allfreightList.add(0);
                    allfreightList.add(j);
                    Object monthsum = airList.get(j).get("MONTHSUM");
                    BigDecimal multiply = new BigDecimal(monthsum.toString()).multiply(new BigDecimal("10000"));
                    allfreightList.add(multiply.intValue());
                    dataList.add(allfreightList);
                } else if (i == 1) {
                    ArrayList<Integer> allfreightList = new ArrayList<>();
                    allfreightList.add(1);
                    allfreightList.add(j);
                    Object monthsum = waterWayList.get(j).get("MONTHSUM");
                    BigDecimal multiply = new BigDecimal(monthsum.toString()).multiply(new BigDecimal("10000"));
                    allfreightList.add(multiply.intValue());
                    dataList.add(allfreightList);
                } else if (i == 2) {
                    ArrayList<Integer> allfreightList = new ArrayList<>();
                    allfreightList.add(2);
                    allfreightList.add(j);
                    Object monthsum = roadTransportList.get(j).get("MONTHSUM");
                    BigDecimal multiply = new BigDecimal(monthsum.toString()).multiply(new BigDecimal("10000"));
                    allfreightList.add(multiply.intValue());
                    dataList.add(allfreightList);
                } else if (i == 3) {
                    ArrayList<Integer> allfreightList = new ArrayList<>();
                    allfreightList.add(3);
                    allfreightList.add(j);
                    Object monthsum = railwayList.get(j).get("MONTHSUM");
                    BigDecimal multiply = new BigDecimal(monthsum.toString()).multiply(new BigDecimal("10000"));
                    allfreightList.add(multiply.intValue());
                    dataList.add(allfreightList);
                }
            }
        }


        //拼接月份的集合
        ArrayList<String> monthList = new ArrayList<>();

        //拼接月份
        for (int i = 0; i < month; i++) {
            if (i == 0) {
                monthList.add("'一月'");
            } else if (i == 1) {
                monthList.add("'二月'");
            } else if (i == 2) {
                monthList.add("'三月'");
            } else if (i == 3) {
                monthList.add("'四月'");
            } else if (i == 4) {
                monthList.add("'五月'");
            } else if (i == 5) {
                monthList.add("'六月'");
            } else if (i == 6) {
                monthList.add("'七月'");
            } else if (i == 7) {
                monthList.add("'八月'");
            } else if (i == 8) {
                monthList.add("'九月'");
            } else if (i == 9) {
                monthList.add("'十月'");
            } else if (i == 10) {
                monthList.add("'十一月'");
            } else if (i == 11) {
                monthList.add("'十二月'");
            }
        }
        cyxt21.setDataItem1(dataList.toString());
        cyxt21.setDataItem2("['机场', '水路', '公路', '铁路']");
        cyxt21.setDataItem3(monthList.toString().replace(" ", ""));
        String tbzz7str = JSONObject.toJSONString(cyxt21, SerializerFeature.WriteMapNullValue);
        list.add(tbzz7str);

        //--------本年日均货物运输量、去年日均货物运输量
        Cyxt cyxt22 = buildgeneralpParame("5ed7fb06e4304054a3d898538680b498", "hyLazy", "myChart6");
        cyxt22.setDataItem1("[{text: '公路', max: 2000000},{text: '水路', max: 2500000},{text: '铁路', max: 2000000},{text: '机场', max: 2000000}]");
        ArrayList<Integer> allYearAvg = new ArrayList<>();
        //公路本年日均
        BigDecimal road1 = new BigDecimal("0");
        for (int i = 0; i < month; i++) {
            BigDecimal yearavg = new BigDecimal(roadTransportList.get(i).get("YEARAVG").toString());
            road1 = road1.add(yearavg);
        }
        road1 = road1.multiply(new BigDecimal("10000")).divide(new BigDecimal(month + ""), 0, BigDecimal.ROUND_HALF_UP);
        allYearAvg.add(road1.intValue());
        //水路本年日均
        BigDecimal waterWay = new BigDecimal("0");
        for (int i = 0; i < month; i++) {
            BigDecimal yearavg = new BigDecimal(waterWayList.get(i).get("YEARAVG").toString());
            waterWay = waterWay.add(yearavg);
        }
        waterWay = waterWay.multiply(new BigDecimal("10000")).divide(new BigDecimal(month + ""), 0, BigDecimal.ROUND_HALF_UP);
        allYearAvg.add(waterWay.intValue());
        //铁路本年日均
        BigDecimal railWay = new BigDecimal("0");
        for (int i = 0; i < month; i++) {
            BigDecimal yearavg = new BigDecimal(railwayList.get(i).get("YEARAVG").toString());
            railWay = railWay.add(yearavg);
        }
        railWay = railWay.multiply(new BigDecimal("10000")).divide(new BigDecimal(month + ""), 0, BigDecimal.ROUND_HALF_UP);
        allYearAvg.add(railWay.intValue());
        //机场本年日均
        BigDecimal airport = new BigDecimal("0");
        for (int i = 0; i < month; i++) {
            BigDecimal yearavg = new BigDecimal(airList.get(i).get("YEARAVG").toString());
            airport = airport.add(yearavg);
        }
        airport = airport.multiply(new BigDecimal("10000")).divide(new BigDecimal(month + ""), 0, BigDecimal.ROUND_HALF_UP);
        allYearAvg.add(airport.intValue());

        cyxt22.setDataItem2(allYearAvg.toString());
        String tbzz8str = JSONObject.toJSONString(cyxt22, SerializerFeature.WriteMapNullValue);
        list.add(tbzz8str);

        //去年日均货物运输量
        Cyxt cyxt23 = buildgeneralpParame("ab604c15e5c94916afc70aaa4066f358", "hyLazy", "myChart7");
        cyxt23.setDataItem1("[{text: '公路', max: 2000000},{text: '水路', max: 2000000},{text: '铁路', max: 2000000},{text: '机场', max: 2000000}]");
        ArrayList<Integer> lastYearAvg = new ArrayList<>();
        //公路去年日均
        BigDecimal road2 = new BigDecimal("0");
        for (int i = 0; i < month; i++) {
            BigDecimal yearavg = new BigDecimal(roadTransportList.get(i).get("SNTY").toString());
            if (i == 0 || i == 2 || i == 4 || i == 6 || i == 7 || i == 9 || i == 11) {
                yearavg = yearavg.divide(new BigDecimal("31"), 0, BigDecimal.ROUND_HALF_UP);
            } else if (i == 3 || i == 5 || i == 8 || i == 10) {
                yearavg = yearavg.divide(new BigDecimal("30"), 0, BigDecimal.ROUND_HALF_UP);
            } else {
                if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                    yearavg = yearavg.divide(new BigDecimal("29"), 0, BigDecimal.ROUND_HALF_UP);
                } else {
                    yearavg = yearavg.divide(new BigDecimal("28"), 0, BigDecimal.ROUND_HALF_UP);
                }
            }
            road2 = road2.add(yearavg);
        }
        road2 = road2.multiply(new BigDecimal("10000")).divide(new BigDecimal(month + ""), 0, BigDecimal.ROUND_HALF_UP);
        lastYearAvg.add(road2.intValue());
        //水路去年日均
        BigDecimal waterroad = new BigDecimal("0");
        for (int i = 0; i < month; i++) {
            BigDecimal yearavg = new BigDecimal(waterWayList.get(i).get("SNTY").toString());
            if (i == 0 || i == 2 || i == 4 || i == 6 || i == 7 || i == 9 || i == 11) {
                yearavg = yearavg.divide(new BigDecimal("31"), 0, BigDecimal.ROUND_HALF_UP);
            } else if (i == 3 || i == 5 || i == 8 || i == 10) {
                yearavg = yearavg.divide(new BigDecimal("30"), 0, BigDecimal.ROUND_HALF_UP);
            } else {
                if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                    yearavg = yearavg.divide(new BigDecimal("29"), 0, BigDecimal.ROUND_HALF_UP);
                } else {
                    yearavg = yearavg.divide(new BigDecimal("28"), 0, BigDecimal.ROUND_HALF_UP);
                }
            }
            waterroad = waterroad.add(yearavg);
        }
        waterroad = waterroad.multiply(new BigDecimal("10000")).divide(new BigDecimal(month + ""), 0, BigDecimal.ROUND_HALF_UP);
        lastYearAvg.add(waterroad.intValue());
        //铁路去年日均
        BigDecimal railwayrood = new BigDecimal("0");
        for (int i = 0; i < month; i++) {
            BigDecimal yearavg = new BigDecimal(railwayList.get(i).get("SNTY").toString());
            if (i == 0 || i == 2 || i == 4 || i == 6 || i == 7 || i == 9 || i == 11) {
                yearavg = yearavg.divide(new BigDecimal("31"), 0, BigDecimal.ROUND_HALF_UP);
            } else if (i == 3 || i == 5 || i == 8 || i == 10) {
                yearavg = yearavg.divide(new BigDecimal("30"), 0, BigDecimal.ROUND_HALF_UP);
            } else {
                if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                    yearavg = yearavg.divide(new BigDecimal("29"), 0, BigDecimal.ROUND_HALF_UP);
                } else {
                    yearavg = yearavg.divide(new BigDecimal("28"), 0, BigDecimal.ROUND_HALF_UP);
                }
            }
            railwayrood = railwayrood.add(yearavg);
        }
        railwayrood = railwayrood.multiply(new BigDecimal("10000")).divide(new BigDecimal(month + ""), 0, BigDecimal.ROUND_HALF_UP);
        lastYearAvg.add(railwayrood.intValue());
        //航空去年日均
        BigDecimal air = new BigDecimal("0");
        for (int i = 0; i < month; i++) {
            BigDecimal yearavg = new BigDecimal(airList.get(i).get("SNTY").toString());
            if (i == 0 || i == 2 || i == 4 || i == 6 || i == 7 || i == 9 || i == 11) {
                yearavg = yearavg.divide(new BigDecimal("31"), 0, BigDecimal.ROUND_HALF_UP);
            } else if (i == 3 || i == 5 || i == 8 || i == 10) {
                yearavg = yearavg.divide(new BigDecimal("30"), 0, BigDecimal.ROUND_HALF_UP);
            } else {
                if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                    yearavg = yearavg.divide(new BigDecimal("29"), 0, BigDecimal.ROUND_HALF_UP);
                } else {
                    yearavg = yearavg.divide(new BigDecimal("28"), 0, BigDecimal.ROUND_HALF_UP);
                }
            }
            air = air.add(yearavg);
        }
        air = air.multiply(new BigDecimal("10000")).divide(new BigDecimal(month + ""), 0, BigDecimal.ROUND_HALF_UP);
        lastYearAvg.add(air.intValue());
        cyxt23.setDataItem2(lastYearAvg.toString());
        String tbzz9str = JSONObject.toJSONString(cyxt23, SerializerFeature.WriteMapNullValue);
        list.add(tbzz9str);


        //----------四个折线图(月趋势)
        //----公路
        buildChart("18cd93cffe534f1e8f70092f766db0ca", "hyLazy", "myChart2", month, "MONTHSUM", "SNTY", monthList, roadTransportList, list);
        //-----水路
        buildChart("17ef6746ac9e4fcda26f77d2db4f565f", "hyLazy", "myChart3", month, "MONTHSUM", "SNTY", monthList, waterWayList, list);
        //----铁路
        buildChart("9a9ebead0308426eb75cfacafc774995", "hyLazy", "myChart4", month, "MONTHSUM", "SNTY", monthList, railwayList, list);
        //----机场
        buildChart("fc8d111441844c4cae11005e795d359d", "hyLazy", "myChart5", month, "MONTHSUM", "SNTY", monthList, airList, list);
        //全港货物吞吐量
        buildHarborThroughput(month, harborList, list, nf);
        //---------两个饼图海河港内外贸累计吞吐量
        buildPieHarborAndTrading(month, seaborList, harborRiverList, foreignTradeList, domesticTradeList, list);
        //本年度【海河港】、上年度【海河港】月趋势
        harbortrend(month, seaborList, harborRiverList, list);
        //本年度【内外贸】、上年度【内外贸】月趋势
        domesticAndforeigntrade(month, foreignTradeList, domesticTradeList, list);
        //集装箱吞吐量、同比
        containerThroughput(month, containerList, list, nf);
        //集装箱【本年度/上年度】货运量月趋势
        buildcontainerTrend(month, containerList, list);
        //月均洋山深水港区完成量
        bulidcontaineryyssgq(month, ssgqList, list, nf);
        //洋山深水港月完成量趋势
        buildyshsMonthlyTrend(month, ssgqList, list);
        //洋山深水港吞吐总量占比月趋势
        buildTotalThroughputMonthlyTrendofpProportion(month, ssgqList, containerList, list);
        return list;

    }

    /**
     * Methad info:货物运输量------月均
     *
     * @author 陈兆庆
     * @date 2022/1/5 11:23
     */
    public void buildfreightMonthAverage(Cyxt cyxt, int month, Map<String, Object> dataMap, List list, NumberFormat nf) {
        //月均
        Object yearsum = dataMap.get("YEARSUM");
        double yearsumd = Double.parseDouble(yearsum.toString());
        double monthavg = yearsumd / month * 10000;
        String format = nf.format(monthavg);
        cyxt.setDataItem1(format);
        String yjhy = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(yjhy);
    }

    /**
     * Methad info:货物运输量------同比增长
     *
     * @author 陈兆庆
     * @date 2022/1/5 14:09
     */

    public void buildfreightYearGrowth(Cyxt cyxt, Map<String, Object> dataMap, List list) {
        Object bnbsntqzjb = dataMap.get("BNBSNTQZJB");
        cyxt.setDataItem1(bnbsntqzjb + "%");
        String tbzz = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(tbzz);
    }

    /**
     * Methad info:货物运输量------累计
     *
     * @author 陈兆庆
     * @date 2022/1/5 14:12
     */

    public void buildfreightYeartotal(Cyxt cyxt, Map<String, Object> dataMap, List list, NumberFormat nf) {
        //--累计（yearSum）
        Object yearsum = dataMap.get("YEARSUM");
        double yearsum1 = Double.parseDouble(yearsum.toString()) * 10000;
        String format1 = nf.format(yearsum1);
        cyxt.setDataItem1(format1);
        String lj = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(lj);
    }

    /**
     * Methad info:货物运输量------同比增量
     *
     * @author 陈兆庆
     * @date 2022/1/5 14:15
     */

    public void buildfreightYeartoYeartotal(Cyxt cyxt, Map<String, Object> dataMap, List list) {
        //-- 同比增量（BNBSNTQZJB字段）
        Object tbzz = dataMap.get("BNBSNTQZJB");
        cyxt.setDataItem1(tbzz + "%");
        String tbzz2str = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(tbzz2str);
    }


    /**
     * Methad info:四个折线图(月趋势)
     *
     * @author 陈兆庆
     * @date 2022/1/4 13:36
     */
    public void buildChart(String id, String mainType, String subType, int month, String keys, String snty, List monthList, List<Map<String, Object>> listdata, List list) {
        Cyxt cyxt = new Cyxt();
        cyxt.setId(id);
        cyxt.setMainType(mainType);
        cyxt.setSubType(subType);
        cyxt.setDataItem1(monthList.toString().replace(" ", ""));
        ArrayList<Integer> roadChart1 = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            Object monthsum = listdata.get(i).get(keys);
            /*     Integer ceil = (int)Math.ceil(Double.valueOf(monthsum.toString()))*10000;//此处数据有差异，后续确认是否向上取整*/
            double ceila = Double.parseDouble(monthsum.toString());
            int ceil = (int) (ceila * 10000);
            roadChart1.add(ceil);
        }
        //去年月总
        ArrayList<Integer> roadChart2 = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            Object monthsum = listdata.get(i).get(snty);
            /*       Integer ceil = (int)Math.ceil(Double.valueOf(monthsum.toString()))*10000;//此处数据有差异，后续确认是否向上取整*/
            double ceila = Double.parseDouble(monthsum.toString());
            int ceil = (int) (ceila * 10000);
            roadChart2.add(ceil);
        }
        cyxt.setDataItem2(roadChart1.toString().replace(" ", ""));
        cyxt.setDataItem3(roadChart2.toString().replace(" ", ""));
        String tbzz10str = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(tbzz10str);
    }

    /**
     * Methad info:全港货物吞吐量、同比
     *
     * @author 陈兆庆
     * @date 2022/1/4 13:39
     */
    public void buildHarborThroughput(int month, List<Map<String, Object>> listdata, List list, NumberFormat nf) {
        Cyxt cyxt = buildgeneralpParame("ccfbc0440da34871bb7322e040a5aeb6", "hyLazy", "bnqghwttl");
        Object yearsumo = listdata.get(month - 1).get("YEARSUM");
        double yearsumd = Double.parseDouble(yearsumo.toString()) * 10000;
        String format = nf.format(yearsumd);
        cyxt.setDataItem1(format);
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
        Cyxt cyxt1 = buildgeneralpParame("d0e047accbc04b0fa95b12a7efb8166b", "hyLazy", "bnqghwttlbfb");
        Object bnbsntqzjb = listdata.get(month - 1).get("BNBSNTQZJB");
        cyxt1.setDataItem1("本年月均全港货物吞吐量(吨)&nbsp;&nbsp;" + bnbsntqzjb + "%");
        String data1 = JSONObject.toJSONString(cyxt1, SerializerFeature.WriteMapNullValue);
        list.add(data1);
        //-------全港货物月均吞吐量、同比
        Cyxt cyxt2 = buildgeneralpParame("c3c85f93f82e4b859d90361bcb4a6e05", "hyLazy", "bnyjqghwttl");
        double harbormonth = (int) (yearsumd / month);
        String qghwyjttl = nf.format(harbormonth);
        cyxt2.setDataItem1(qghwyjttl);
        String data2 = JSONObject.toJSONString(cyxt2, SerializerFeature.WriteMapNullValue);
        list.add(data2);
        Cyxt cyxt3 = buildgeneralpParame("65f55ad74aa0487dbd3befcfeaa05b8f", "hyLazy", "bnyjqghwttlbfb");
        cyxt3.setDataItem1("本年月均全港货物吞吐量(吨)&nbsp;&nbsp;" + bnbsntqzjb + "%");
        String data3 = JSONObject.toJSONString(cyxt3, SerializerFeature.WriteMapNullValue);
        list.add(data3);
        //-------全港货物吞吐量月趋势【本年、上年】
        Cyxt cyxt4 = buildgeneralpParame("c9d1810011024f409861987dd357ab1e", "hyLazy", "myChart8");
        List monthList = buildMonth(month);
        cyxt4.setDataItem1(monthList.toString().replace(" ", ""));
        ArrayList<Integer> yearList1 = new ArrayList<>();//今年
        for (int i = 0; i < month; i++) {
            Object yearsum = listdata.get(i).get("MONTHSUM");
            int yeartosum = (int) (Double.parseDouble(yearsum.toString()) * 10000);
            yearList1.add(yeartosum);
        }
        cyxt4.setDataItem2(yearList1.toString().replace(" ", ""));
        ArrayList<Integer> yearList2 = new ArrayList<>();//去年
        for (int i = 0; i < month; i++) {
            Object yearsum = listdata.get(i).get("SNTY");
            int yeartosum = (int) (Double.parseDouble(yearsum.toString()) * 10000);
            yearList2.add(yeartosum);
        }
        cyxt4.setDataItem3(yearList2.toString().replace(" ", ""));
        String data4 = JSONObject.toJSONString(cyxt4, SerializerFeature.WriteMapNullValue);
        list.add(data4);
    }


    /**
     * Methad info:两个饼图（海河港、内外贸）累计吞吐量
     *
     * @author 陈兆庆
     * @date 2022/1/4 15:23
     */

    public void buildPieHarborAndTrading(int month, List<Map<String, Object>> seaborList, List<Map<String, Object>> harborRiverList, List<Map<String, Object>> foreignTradeList, List<Map<String, Object>> domesticTradeList, List list) {
        //河海港
        Cyxt cyxt = buildgeneralpParame("40029256468f437fbc9f5f818e0afd20", "hyLazy", "myChart9");
        Object yearsumSea = seaborList.get(month - 1).get("YEARSUM");
        Object yearsumRiver = harborRiverList.get(month - 1).get("YEARSUM");
        //海港年累计
        int yearsum1 = (int) (Double.parseDouble(yearsumSea.toString()) * 10000);
        //内河港年累计
        int yearsum2 = (int) (Double.parseDouble(yearsumRiver.toString()) * 10000);
        cyxt.setDataItem1("[{value: " + yearsum1 + ",name: '海港'},{value: " + yearsum2 + ", name: '内河港'}]");
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
        //内外贸
        Cyxt cyxt1 = buildgeneralpParame("78367b7bf3294f9582693c29c45753e6", "hyLazy", "myChart10");
        Object foreignTrade = foreignTradeList.get(month - 1).get("YEARSUM");
        Object domesticTrade = domesticTradeList.get(month - 1).get("YEARSUM");
        //外贸年累计
        int foreignTradeSum = (int) (Double.parseDouble(foreignTrade.toString()) * 10000);
        //内贸年累计
        int domesticTradeSum = (int) (Double.parseDouble(domesticTrade.toString()) * 10000);
        cyxt1.setDataItem1("[{value: " + foreignTradeSum + ",name: '外贸'},{value: " + domesticTradeSum + ", name: '内贸'}]");
        String data1 = JSONObject.toJSONString(cyxt1, SerializerFeature.WriteMapNullValue);
        list.add(data1);
    }

    /**
     * Methad info:本年度【海河港】、上年度【海河港】月趋势
     *
     * @author 陈兆庆
     * @date 2022/1/4 16:11
     */

    public void harbortrend(int month, List<Map<String, Object>> seaborList, List<Map<String, Object>> harborRiverList, List list) {
        Cyxt cyxt = buildgeneralpParame("e58cfcff2a384117939c848dc8530c89", "hyLazy", "myChart12");
        List monthList = buildMonth(month);
        cyxt.setDataItem1(monthList.toString().replace(" ", ""));
        //本年度海港
        ArrayList<Integer> seaPortofthisyear = new ArrayList<>();
        //上年度海港
        ArrayList<Integer> seaPortoflastyear = new ArrayList<>();
        //本年度内河港
        ArrayList<Integer> riverPortofthisyear = new ArrayList<>();
        //上年度内河港
        ArrayList<Integer> riverPortoflastyear = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            Object monthsum = seaborList.get(i).get("MONTHSUM");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            seaPortofthisyear.add(yearsum1);
        }
        for (int i = 0; i < month; i++) {
            Object monthsum = seaborList.get(i).get("SNTY");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            seaPortoflastyear.add(yearsum1);
        }
        for (int i = 0; i < month; i++) {
            Object monthsum = harborRiverList.get(i).get("MONTHSUM");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            riverPortofthisyear.add(yearsum1);
        }
        for (int i = 0; i < month; i++) {
            Object monthsum = harborRiverList.get(i).get("SNTY");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            riverPortoflastyear.add(yearsum1);
        }
        cyxt.setDataItem2(seaPortofthisyear.toString().replace(" ", ""));
        cyxt.setDataItem3(riverPortofthisyear.toString().replace(" ", ""));
        cyxt.setDataItem4(seaPortoflastyear.toString().replace(" ", ""));
        cyxt.setDataItem5(riverPortoflastyear.toString().replace(" ", ""));
        String data1 = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data1);
    }

    /**
     * Methad info:本年度【内外贸】、上年度【内外贸】月趋势
     *
     * @author 陈兆庆
     * @date 2022/1/4 16:11
     */

    public void domesticAndforeigntrade(int month, List<Map<String, Object>> foreignTradeList, List<Map<String, Object>> domesticTradeList, List list) {
        Cyxt cyxt = buildgeneralpParame("b83030edd04b4ab9ac923103e232e95b", "hyLazy", "myChart13");
        List monthList = buildMonth(month);
        //拼接月份
        cyxt.setDataItem1(monthList.toString().replace(" ", ""));
        //本年度内贸
        ArrayList<Integer> domestictradethisyear = new ArrayList<>();
        //本年度外贸
        ArrayList<Integer> foreigntradethisyear = new ArrayList<>();
        //上年度内贸
        ArrayList<Integer> domestictradelastyear = new ArrayList<>();
        //上年度外贸
        ArrayList<Integer> foreigntradelastyear = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            Object monthsum = domesticTradeList.get(i).get("MONTHSUM");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            domestictradethisyear.add(yearsum1);
        }
        for (int i = 0; i < month; i++) {
            Object monthsum = domesticTradeList.get(i).get("SNTY");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            domestictradelastyear.add(yearsum1);
        }
        for (int i = 0; i < month; i++) {
            Object monthsum = foreignTradeList.get(i).get("MONTHSUM");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            foreigntradethisyear.add(yearsum1);
        }
        for (int i = 0; i < month; i++) {
            Object monthsum = foreignTradeList.get(i).get("SNTY");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            foreigntradelastyear.add(yearsum1);
        }
        cyxt.setDataItem2(domestictradethisyear.toString().replace(" ", ""));
        cyxt.setDataItem3(foreigntradethisyear.toString().replace(" ", ""));
        cyxt.setDataItem4(domestictradelastyear.toString().replace(" ", ""));
        cyxt.setDataItem5(foreigntradelastyear.toString().replace(" ", ""));
        String data1 = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data1);
    }

    /**
     * Methad info:集装箱月均吞吐量、同比
     *
     * @author 陈兆庆
     * @date 2022/1/4 17:33
     */

    public void containerThroughput(int month, List<Map<String, Object>> containerList, List list, NumberFormat nf) {
        Cyxt cyxt = buildgeneralpParame("3e8e31dd847541668cb540407b0b492f", "hyLazy", "bnjzxttl");
        Object yearsum = containerList.get(month - 1).get("YEARSUM");
        double yearsum1 = Double.parseDouble(yearsum.toString()) * 10000;
        String format1 = nf.format(yearsum1);
        cyxt.setDataItem1(format1);
        String data1 = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data1);
        Cyxt cyxt1 = buildgeneralpParame("12eb3ed1d8de455aa2b46a3430aa516b", "hyLazy", "bnjzxttlbfb");
        Object tb = containerList.get(month - 1).get("BNBSNTQZJB");
        cyxt1.setDataItem1("本年集装箱吞吐量(TUE)&nbsp;&nbsp;" + tb + "%");
        String data2 = JSONObject.toJSONString(cyxt1, SerializerFeature.WriteMapNullValue);
        list.add(data2);
        Cyxt cyxt2 = buildgeneralpParame("64d8ba8bf0e34b41a3111d37586f6614", "hyLazy", "bnyjjzxttl");
        double monthAvg = (int) yearsum1 / month;
        String monthAvgstr = nf.format(monthAvg);
        cyxt2.setDataItem1(monthAvgstr);
        String data3 = JSONObject.toJSONString(cyxt2, SerializerFeature.WriteMapNullValue);
        list.add(data3);
        Cyxt cyxt3 = buildgeneralpParame("06f69189cec141f0977336a0a4b8f6a1", "hyLazy", "bnyjjzxttlbfb");
        cyxt3.setDataItem1("本年月均集装箱吞吐量(TUE)  " + tb + "%");
        String data4 = JSONObject.toJSONString(cyxt3, SerializerFeature.WriteMapNullValue);
        list.add(data4);
    }

    /**
     * Methad info:集装箱【本年度/上年度】货运量月趋势
     *
     * @author 陈兆庆
     * @date 2022/1/4 17:34
     */
    public void buildcontainerTrend(int month, List<Map<String, Object>> containerList, List list) {
        Cyxt cyxt = buildgeneralpParame("6c57021c6a8147f88a3ec9ecf5ed3d82", "hyLazy", "myChart15");
        List monthList = buildMonth(month);
        cyxt.setDataItem1(monthList.toString().replace(" ", ""));
        //本年度货运量
        ArrayList<Integer> containerthisList = new ArrayList<>();
        //上年度货运量
        ArrayList<Integer> containerlastList = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            Object monthsum = containerList.get(i).get("MONTHSUM");
            int monSum = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            containerthisList.add(monSum);
        }
        for (int i = 0; i < month; i++) {
            Object monthsum = containerList.get(i).get("SNTY");
            int monSum = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            containerlastList.add(monSum);
        }
        cyxt.setDataItem2(containerthisList.toString().replace(" ", ""));
        cyxt.setDataItem3(containerlastList.toString().replace(" ", ""));
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
    }

    /**
     * Methad info:月均洋山深水港区完成量和累计洋山深水港完成量
     *
     * @author 陈兆庆
     * @date 2022/1/4 17:58
     */

    public void bulidcontaineryyssgq(int month, List<Map<String, Object>> ssgqList, List list, NumberFormat nf) {
        Cyxt cyxt = buildgeneralpParame("e31343f5310f4f859a5a2567e5298e64", "hyLazy", "bnyjysssg");
        Object yearsum = ssgqList.get(month - 1).get("YEARSUM");
        double yearsum1 = (int) Double.parseDouble(yearsum.toString()) * 10000 / month;
        String format1 = nf.format(yearsum1);
        cyxt.setDataItem1(format1);
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
        Cyxt cyxt1 = buildgeneralpParame("72599e47cc1b4bc9be8790d1c55f3f59", "hyLazy", "bnyjysssgbfb");
        Object ttzz = ssgqList.get(month - 1).get("BNBSNTQZJB");
        cyxt1.setDataItem1("&nbsp;&nbsp;" + ttzz + "%");
        String data1 = JSONObject.toJSONString(cyxt1, SerializerFeature.WriteMapNullValue);
        list.add(data1);
        Cyxt cyxt2 = buildgeneralpParame("e8b8bfbc0fee4bec8eccb8328a08bd5b", "hyLazy", "bnljysssg");
        double yearsum2 = (int) Double.parseDouble(yearsum.toString()) * 10000;
        cyxt2.setDataItem1(nf.format(yearsum2));
        String data2 = JSONObject.toJSONString(cyxt2, SerializerFeature.WriteMapNullValue);
        list.add(data2);
        Cyxt cyxt3 = buildgeneralpParame("0bd2c7ff14df4411adb1618205ee4ede", "hyLazy", "bnljysssgbfb");
        cyxt3.setDataItem1("&nbsp;&nbsp;" + ttzz + "%");
        String data4 = JSONObject.toJSONString(cyxt3, SerializerFeature.WriteMapNullValue);
        list.add(data4);
    }

    /**
     * Methad info:洋山深水港月完成量趋势(TEU)
     *
     * @author 陈兆庆
     * @date 2022/1/5 10:26
     */

    public void buildyshsMonthlyTrend(int month, List<Map<String, Object>> ssgqList, List list) {
        Cyxt cyxt = buildgeneralpParame("a4e2db1267f142adb79d0706f0ca0e9b", "hyLazy", "myChart19");
        cyxt.setDataItem1(buildMonth(month).toString().replace(" ", ""));
        ArrayList<Integer> thisYear = new ArrayList<>();
        ArrayList<Integer> lastYear = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            Object monthsum = ssgqList.get(i).get("MONTHSUM");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            thisYear.add(yearsum1);
        }
        for (int i = 0; i < month; i++) {
            Object monthsum = ssgqList.get(i).get("SNTY");
            int yearsum1 = (int) (Double.parseDouble(monthsum.toString()) * 10000);
            lastYear.add(yearsum1);
        }
        cyxt.setDataItem2(thisYear.toString().replace(" ", ""));
        cyxt.setDataItem3(lastYear.toString().replace(" ", ""));
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
    }

    /**
     * Methad info:,洋山深水港吞吐总量占比月趋势
     *
     * @author 陈兆庆
     * @date 2022/1/5 10:51
     */
    public void buildTotalThroughputMonthlyTrendofpProportion(int month, List<Map<String, Object>> ssgqList, List<Map<String, Object>> containerList, List list) {
        Cyxt cyxt = buildgeneralpParame("481383e695394c50827badbc8efe4d9d", "hyLazy", "myChart20");
        cyxt.setDataItem1(buildMonth(month).toString().replace(" ", ""));
        ArrayList<String> dataList = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            //公式：（洋山深水港区月完成量除以集装箱月吞吐量乘以100）
            Object monthsunssgq = ssgqList.get(i).get("MONTHSUM");//深水港
            Object monthsunjzx = containerList.get(i).get("MONTHSUM");//集装箱
            double data = (Double.parseDouble(monthsunssgq.toString()) / Double.parseDouble(monthsunjzx.toString())) * 100;
            String result = String.format("%.2f", data);
            dataList.add(result);
        }
        cyxt.setDataItem2(dataList.toString().replace(" ", ""));
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
    }

    //build客运数据
    public List<String> buildPassengerTransport() {
        Calendar cal = Calendar.getInstance();
        NumberFormat nf = NumberFormat.getInstance();
        nf.setMaximumFractionDigits(0);//保留0位
        //获得当前月份
        int month = new Date().getMonth();
        month = 11;//因目前1月份数据库未产生12月份数据，此此先模拟
        //获得当前年份
        int year = cal.get(Calendar.YEAR);
        ArrayList<String> list = new ArrayList<>();//用来存储所有的最终的json
        //初始对外旅客发送量的map
        Map<String, Object> travelerMap = initTraveler().get(month - 1);
        //初始化公路旅客发送量的map
        Map<String, Object> highwayMap = initHighway().get(month - 1);
        //初始化水路旅客发送量的map
        Map<String, Object> waterWayMap = initWaterway().get(month - 1);
        //初始化铁路旅客发送量的map
        Map<String, Object> railwayMap = initrailway().get(month - 1);
        //初始化航空旅客发送量的map
        Map<String, Object> aviationMap = initaviation().get(month - 1);

        //初始化公路旅客发送量的list
        List<Map<String, Object>> highwayList = initHighway();
        //初始化水路旅客发送量的list
        List<Map<String, Object>> waterWayList = initWaterway();
        //初始化铁路旅客发送量的list
        List<Map<String, Object>> railWayList = initrailway();
        //初始化航空旅客发送量的list
        List<Map<String, Object>> aviationList = initaviation();
        //初始化拼接月份的集合
        List monthList = buildMonth(month);


        //对外旅客月均
        Cyxt cyxt1 = buildgeneralpParame("fc3120c3bd234608a0413fc73718d737", "kyLazy", "ydwlkfsl");
        buildPassengerTransportMonthAvg(cyxt1, month, travelerMap, list, nf);
        //对外旅客同比增量
        Cyxt cyxt2 = buildgeneralpParame("44181093a0324ed095afa669ea385a79", "kyLazy", "ydwlkfslbfb");
        buildTravelerYeartoYeartotal(cyxt2, travelerMap, list);
        //对外旅客累计
        Cyxt cyxt3 = buildgeneralpParame("9ab8c165b7e14d2cab1f63e0e98da18d", "kyLazy", "tdwlkfsl");
        buildTravelerYeartotal(cyxt3, travelerMap, list, nf);
        //对外旅客同比增长
        Cyxt cyxt4 = buildgeneralpParame("161fa26ff8784d93818a4a2127d8c9d1", "kyLazy", "tdwlkfslbfb");
        buildTravelerYeartoYeartotal(cyxt4, travelerMap, list);


        //公路旅客月均
        Cyxt cyxt5 = buildgeneralpParame("9c071c5aaa47459ba649fbd912ff5dff", "kyLazy", "ygllkfsl");
        buildPassengerTransportMonthAvg(cyxt5, month, highwayMap, list, nf);
        //公路旅客同比增量
        Cyxt cyxt6 = buildgeneralpParame("2e222537b72142f79050175e64590644", "kyLazy", "ygllkfslbfb");
        buildTravelerYeartoYeartotal(cyxt6, highwayMap, list);
        //公路旅客累计
        Cyxt cyxt7 = buildgeneralpParame("d153d635324e4ff89887651110e7c85b", "kyLazy", "tgllkfsl");
        buildTravelerYeartotal(cyxt7, highwayMap, list, nf);
        //公路旅客同比增长
        Cyxt cyxt8 = buildgeneralpParame("d02237ec3809405cbc8bacc5fd33dfb3", "kyLazy", "tgllkfslbfb");
        buildTravelerYeartoYeartotal(cyxt8, highwayMap, list);

        //水路旅客月均
        Cyxt cyxt9 = buildgeneralpParame("200df9601ead4f67a25433cfe1c5abaa", "kyLazy", "ysllkfsl");
        buildPassengerTransportMonthAvg(cyxt9, month, waterWayMap, list, nf);
        //水路旅客同比增量
        Cyxt cyxt10 = buildgeneralpParame("61cdfbb4b13f44f3b5b35e08ce33d7cf", "kyLazy", "ysllkfslbfb");
        buildTravelerYeartoYeartotal(cyxt10, waterWayMap, list);
        //水路旅客累计
        Cyxt cyxt11 = buildgeneralpParame("0541819cca33439197a3024ee5429791", "kyLazy", "tsllkfsl");
        buildTravelerYeartotal(cyxt11, waterWayMap, list, nf);
        //水路旅客同比增长
        Cyxt cyxt12 = buildgeneralpParame("0bebc290650e4df583fed17b484b7b59", "kyLazy", "tsllkfslbfb");
        buildTravelerYeartoYeartotal(cyxt12, waterWayMap, list);

        //铁路旅客月均
        Cyxt cyxt13 = buildgeneralpParame("d4287df230c44c02ae876cbd65758ba0", "kyLazy", "ytllvfsl");
        buildPassengerTransportMonthAvg(cyxt13, month, railwayMap, list, nf);
        //铁路旅客同比增量
        Cyxt cyxt14 = buildgeneralpParame("26720b6e34e5416a9eec756f7c6f0862", "kyLazy", "ytllvfslbfb");
        buildTravelerYeartoYeartotal(cyxt14, railwayMap, list);
        //铁路旅客累计
        Cyxt cyxt15 = buildgeneralpParame("460d2764670d43f68256cd849842ca10", "kyLazy", "ttllvfsl");
        buildTravelerYeartotal(cyxt15, railwayMap, list, nf);
        //铁路旅客同比增长
        Cyxt cyxt16 = buildgeneralpParame("fa396d34aa2347f085e12dd48930bfc3", "kyLazy", "ttllvfslbfb");
        buildTravelerYeartoYeartotal(cyxt16, railwayMap, list);

        //航空旅客月均
        Cyxt cyxt17 = buildgeneralpParame("a3ebd93786eb4b26b89d6471111c5abe", "kyLazy", "yhklvfsl");
        buildPassengerTransportMonthAvg(cyxt17, month, aviationMap, list, nf);
        //航空旅客同比增量
        Cyxt cyxt18 = buildgeneralpParame("70c2d442e7cd4518808cf7e4797ff967", "kyLazy", "yhklvfslbfb");
        buildTravelerYeartoYeartotal(cyxt18, aviationMap, list);
        //航空旅客累计
        Cyxt cyxt19 = buildgeneralpParame("45cae5c9c559416ebdd21c2a52d2f4ce", "kyLazy", "thklvfsl");
        buildTravelerYeartotal(cyxt19, aviationMap, list, nf);
        //航空旅客同比增长
        Cyxt cyxt20 = buildgeneralpParame("f94e25b8f16b4c288ebe1ddaa28f142f", "kyLazy", "thklvfslbfb");
        buildTravelerYeartoYeartotal(cyxt20, aviationMap, list);


        //------------本年、去年【四个方式】日均旅客发送量
        Cyxt cyxt22 = buildgeneralpParame("ef508270cc4e45e0a0ec680f9e839840", "kyLazy", "myChart1");
        cyxt22.setDataItem1("[{text: '公路', max: 150000},{text: '水路', max: 150000},{text: '铁路', max: 150000},{text: '航空', max: 150000}]");
        ArrayList<Integer> allYearAvg = new ArrayList<>();
        //获得截止需统计月份的天数
        int days = getDays(year, month);
        //公路本年日均
        BigDecimal road1 = new BigDecimal("0");
        BigDecimal highWayYearSum = new BigDecimal(highwayList.get(month - 1).get("YEARSUM").toString());
        road1 = highWayYearSum.multiply(new BigDecimal("10000")).divide(new BigDecimal(days + ""), 0, BigDecimal.ROUND_HALF_UP);
        allYearAvg.add(road1.intValue());
        //水路本年日均
        BigDecimal waterWay = new BigDecimal("0");
        BigDecimal waterWayYearSum = new BigDecimal(waterWayList.get(month - 1).get("YEARSUM").toString());
        waterWay = waterWayYearSum.multiply(new BigDecimal("10000")).divide(new BigDecimal(days + ""), 0, BigDecimal.ROUND_HALF_UP);
        allYearAvg.add(waterWay.intValue());

        //铁路本年日均
        BigDecimal railWay = new BigDecimal("0");
        BigDecimal railWaySum = new BigDecimal(railWayList.get(month - 1).get("YEARSUM").toString());
        railWay = railWaySum.multiply(new BigDecimal("10000")).divide(new BigDecimal(days + ""), 0, BigDecimal.ROUND_HALF_UP);
        allYearAvg.add(railWay.intValue());
        //机场本年日均
        BigDecimal airport = new BigDecimal("0");
        BigDecimal airportYearSum = new BigDecimal(aviationList.get(month - 1).get("YEARSUM").toString());
        airport = airportYearSum.multiply(new BigDecimal("10000")).divide(new BigDecimal(days + ""), 0, BigDecimal.ROUND_HALF_UP);
        allYearAvg.add(airport.intValue());

        cyxt22.setDataItem2(allYearAvg.toString());
        String tbzz8str = JSONObject.toJSONString(cyxt22, SerializerFeature.WriteMapNullValue);
        list.add(tbzz8str);

        //获得去年对应月份天数
        int lastDays = getlastYearDays(year, month);

        //去年【四个方式】日均旅客发送量

        Cyxt cyxt23 = buildgeneralpParame("5e87bd0fab814f0596b1bcfe79038000", "kyLazy", "myChart2");
        cyxt23.setDataItem1("[{text: '公路', max: 350000},{text: '水路', max: 350000},{text: '铁路', max: 350000},{text: '航空', max: 350000}]");
        ArrayList<Integer> lastYearAvg = new ArrayList<>();
        //公路去年日均
        BigDecimal road2 = new BigDecimal("0");
        BigDecimal highWayLastYearSum = new BigDecimal(highwayList.get(month - 1).get("SNTQLJ").toString());
        road2 = highWayLastYearSum.multiply(new BigDecimal("10000")).divide(new BigDecimal(lastDays + ""), 0, BigDecimal.ROUND_HALF_UP);
        lastYearAvg.add(road2.intValue());
        //水路去年日均
        BigDecimal waterroad = new BigDecimal("0");
        BigDecimal waterWayLastYearSum = new BigDecimal(waterWayList.get(month - 1).get("SNTQLJ").toString());
        waterroad = waterWayLastYearSum.multiply(new BigDecimal("10000")).divide(new BigDecimal(lastDays + ""), 0, BigDecimal.ROUND_HALF_UP);
        lastYearAvg.add(waterroad.intValue());
        //铁路去年日均
        BigDecimal railwayrood = new BigDecimal("0");
        BigDecimal railWayLastYearSum = new BigDecimal(railWayList.get(month - 1).get("SNTQLJ").toString());
        railwayrood = railWayLastYearSum.multiply(new BigDecimal("10000")).divide(new BigDecimal(lastDays + ""), 0, BigDecimal.ROUND_HALF_UP);
        lastYearAvg.add(railwayrood.intValue());
        //航空去年日均
        BigDecimal air = new BigDecimal("0");
        BigDecimal aviationLastYearSum = new BigDecimal(aviationList.get(month - 1).get("SNTQLJ").toString());
        air = aviationLastYearSum.multiply(new BigDecimal("10000")).divide(new BigDecimal(lastDays + ""), 0, BigDecimal.ROUND_HALF_UP);
        lastYearAvg.add(air.intValue());
        cyxt23.setDataItem2(lastYearAvg.toString());
        String tbzz9str = JSONObject.toJSONString(cyxt23, SerializerFeature.WriteMapNullValue);
        list.add(tbzz9str);
        //-------------旅客发送量月分布
        Cyxt cyxt24 = buildgeneralpParame("64219af6d8274f0cbcf9d2de5812d72e", "kyLazy", "myChart3");
        buildTravelerMonthdata(cyxt24, month, aviationList, waterWayList, highwayList, railWayList, list);
        //-------------四条折线图
        //--公路
        buildChart("a34520ab73c54dbab77dd984202ee45d", "kyLazy", "myChart4", month, "MONTHSUM", "SNTY", monthList, highwayList, list);
        //--水路
        buildChart("94e700453c7a4c508a32b431ae4c834b", "kyLazy", "myChart5", month, "MONTHSUM", "SNTY", monthList, waterWayList, list);
        //--铁路
        buildChart("3a9ba7d98c3d44df8340f70291b3574d", "kyLazy", "myChart6", month, "MONTHSUM", "SNTY", monthList, railWayList, list);
        //--航空
        buildChart("82bfec42ede446f5a64bb4acbf018556", "kyLazy", "myChart7", month, "MONTHSUM", "SNTY", monthList, aviationList, list);

        return list;

    }

    /**
     * Methad info:----月均
     *
     * @author 陈兆庆
     * @date 2022/1/5 16:02
     */
    public void buildPassengerTransportMonthAvg(Cyxt cyxt, int month, Map<String, Object> dataMap, List list, NumberFormat nf) {
        //月均
        Object yearsum = dataMap.get("YEARSUM");
        double yearsumd = Double.parseDouble(yearsum.toString());
        double monthavg = yearsumd / month * 10000;
        String format = nf.format(monthavg);
        cyxt.setDataItem1(format);
        String yjhy = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(yjhy);
    }

    /**
     * Methad info:---同比增长
     *
     * @author 陈兆庆
     * @date 2022/1/5 14:15
     */

    public void buildTravelerYeartoYeartotal(Cyxt cyxt, Map<String, Object> dataMap, List list) {
        //-- 同比增量（BNBSNTQZJB字段）
        Object tbzz = dataMap.get("BNBSNTQZJB");
        cyxt.setDataItem1(tbzz + "%");
        String tbzz2str = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(tbzz2str);
    }

    /**
     * Methad info:------累计
     *
     * @author 陈兆庆
     * @date 2022/1/5 14:12
     */

    public void buildTravelerYeartotal(Cyxt cyxt, Map<String, Object> dataMap, List list, NumberFormat nf) {
        //--累计（yearSum）
        Object yearsum = dataMap.get("YEARSUM");
        double yearsum1 = Double.parseDouble(yearsum.toString()) * 10000;
        String format1 = nf.format(yearsum1);
        cyxt.setDataItem1(format1);
        String lj = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(lj);
    }

    /**
     * Methad info:-------------旅客发送量月分布
     *
     * @author 陈兆庆
     * @date 2022/1/5 18:10
     */

    public void buildTravelerMonthdata(Cyxt cyxt, int month, List<Map<String, Object>> aviationList, List<Map<String, Object>> waterWayList, List<Map<String, Object>> highwayList, List<Map<String, Object>> railWayList, List list) {
        ArrayList<List<Integer>> dataList = new ArrayList<>();
        for (int i = 0; i < 4; i++) {
            for (int j = 0; j < month; j++) {
                if (i == 0) {
                    ArrayList<Integer> allfreightList = new ArrayList<>();
                    allfreightList.add(0);
                    allfreightList.add(j);
                    Object monthsum = aviationList.get(j).get("MONTHSUM");
                    BigDecimal multiply = new BigDecimal(monthsum.toString()).multiply(new BigDecimal("10000"));
                    allfreightList.add(multiply.intValue());
                    dataList.add(allfreightList);
                } else if (i == 1) {
                    ArrayList<Integer> allfreightList = new ArrayList<>();
                    allfreightList.add(1);
                    allfreightList.add(j);
                    Object monthsum = waterWayList.get(j).get("MONTHSUM");
                    BigDecimal multiply = new BigDecimal(monthsum.toString()).multiply(new BigDecimal("10000"));
                    allfreightList.add(multiply.intValue());
                    dataList.add(allfreightList);
                } else if (i == 2) {
                    ArrayList<Integer> allfreightList = new ArrayList<>();
                    allfreightList.add(2);
                    allfreightList.add(j);

                    Object monthsum = highwayList.get(j).get("MONTHSUM");
                    BigDecimal multiply = new BigDecimal(monthsum.toString()).multiply(new BigDecimal("10000"));
                    allfreightList.add(multiply.intValue());
                    dataList.add(allfreightList);
                } else if (i == 3) {
                    ArrayList<Integer> allfreightList = new ArrayList<>();
                    allfreightList.add(3);
                    allfreightList.add(j);
                    Object monthsum = railWayList.get(j).get("MONTHSUM");
                    BigDecimal multiply = new BigDecimal(monthsum.toString()).multiply(new BigDecimal("10000"));
                    allfreightList.add(multiply.intValue());
                    dataList.add(allfreightList);
                }
            }
        }
        cyxt.setDataItem1(dataList.toString());
        cyxt.setDataItem2("['机场', '水路', '公路', '铁路']");
        cyxt.setDataItem3(buildMonth(month).toString().replace(" ", ""));
        String tbzzstr = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(tbzzstr);
    }

    //首页大屏
    public List<String> buildHomeScreen() {
        Calendar cal = Calendar.getInstance();
        NumberFormat nf = NumberFormat.getInstance();
        nf.setMaximumFractionDigits(0);//保留0位
        //获得当前月份
        int month = new Date().getMonth();
        month = 11;//因目前1月份数据库未产生12月份数据，此此先模拟
        //获得当前年份
        int year = cal.get(Calendar.YEAR);
        ArrayList<String> list = new ArrayList<>();//用来存储所有的最终的json
        //初始化全社会货物运输量
        List<Map<String, Object>> societyList = init();
        //初始化全港货物吞吐量
        List<Map<String, Object>> harborList = initHarborThroughput();
        //初始化集装箱吞吐量
        List<Map<String, Object>> containerList = initcontainer();
        //初始化公路旅客发送量的list
        List<Map<String, Object>> highwayList = initHighway();
        //初始化水路旅客发送量的list
        List<Map<String, Object>> waterWayList = initWaterway();
        //初始化铁路旅客发送量的list
        List<Map<String, Object>> railWayList = initrailway();
        //初始化航空旅客发送量的list
        List<Map<String, Object>> aviationList = initaviation();

        //初始化公路货物运输量
        List<Map<String, Object>> roadTransportList = initRoadTransport();
        //初始化水路货物运输量
        List<Map<String, Object>> waterWayFreightList = initWaterWayTransport();
        //初始化铁路货物运输量
        List<Map<String, Object>> railwayList = initrailwayTransport();
        //初始化航空货物运输量
        List<Map<String, Object>> airList = initairTransport();

        //---日均全社会货物运输量（吨）
        Cyxt cyxt1 = buildgeneralpParame("dfa31eaa9393444f9fe6da6978657a3b", "indexLazy", "rjqshhwyxl");
        buildTransportationOfDay(cyxt1, year, month, societyList, list, nf);

        //----日均全港货物吞吐量（吨）
        Cyxt cyxt2 = buildgeneralpParame("b24a7f898c354689830ab56eee1b3bf8", "indexLazy", "rjqghwttl");
        buildTransportationOfDay(cyxt2, year, month, harborList, list, nf);

        //-----日均集装箱吞吐量（TEU）
        Cyxt cyxt3 = buildgeneralpParame("dd2c957fd0b84ce4b9119e88578ec4b7", "indexLazy", "rjjzxttl");
        buildTransportationOfDay(cyxt3, year, month, containerList, list, nf);

        //-----右方饼图(累计)
        Cyxt cyxt4 = buildgeneralpParame("dd2027828d5045eebad1eaa40a2975dc", "indexLazy", "chart1");
        buildRightChart(cyxt4, month, highwayList, waterWayList, railWayList, aviationList, list);

        //------港口货物吞吐量圈图
        Cyxt cyxt5 = buildgeneralpParame("b62550340c0a474983f4a61504f96b22", "indexLazy", "chart2");
        buildPortCargo(cyxt5, month, harborList, list);
        //------集装箱吞吐量圈图
        Cyxt cyxt6 = buildgeneralpParame("ed15abb530ee4fe3968302832159b0ec", "indexLazy", "chart3");
        buildPortCargo(cyxt6, month, containerList, list);
        //-----四种方式【货运】（折线图）
        Cyxt cyxt7 = buildgeneralpParame("1832a6e0b4ea4b62a266f9325910b5a7", "indexLazy", "chart4");
        buildFreightChart(cyxt7, month, roadTransportList, waterWayFreightList, railwayList, airList, list);
        //-------四种方式【客运】（折线图）
        Cyxt cyxt8 = buildgeneralpParame("1f56fc2ef9274e66b8042a7bc9ca588b", "indexLazy", "chart5");
        buildPassengerTransport(cyxt8, month, highwayList, waterWayList, railWayList, aviationList, list);

        return list;
    }

    /**
     * Methad info:-----右方饼图(累计)
     *
     * @author 陈兆庆
     * @date 2022/1/6 10:12
     */
    public void buildRightChart(Cyxt cyxt, int month, List<Map<String, Object>> highwayList, List<Map<String, Object>> waterWayList, List<Map<String, Object>> railWayList, List<Map<String, Object>> aviationList, List list) {
        //公路旅客发送量
        Object yearsumgl = highwayList.get(month - 1).get("YEARSUM");
        int gl = (int) (Double.parseDouble(yearsumgl.toString()) * 10000);
        //水路旅客发送量
        Object yearsumsl = waterWayList.get(month - 1).get("YEARSUM");
        int sl = (int) (Double.parseDouble(yearsumsl.toString()) * 10000);
        //铁路旅客发送量
        Object yearsumtl = railWayList.get(month - 1).get("YEARSUM");
        int tl = (int) (Double.parseDouble(yearsumtl.toString()) * 10000);
        //航空旅客发送量
        Object yearsumhk = aviationList.get(month - 1).get("YEARSUM");
        int hk = (int) (Double.parseDouble(yearsumhk.toString()) * 10000);
        cyxt.setDataItem1("[{value: " + gl + ", name: '公路旅客发送量(人次)'},{value: " + sl + ", name: '水路旅客发送量(人次)'},{value: " + tl + " , name: '铁路旅客发送量(人次)'},{value: " + hk + ", name: '航空旅客发送量(人次)'}]");
        String yjhy = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(yjhy);
    }


    /**
     * Methad info:日均运输量
     *
     * @author 陈兆庆
     * @date 2022/1/6 10:23
     */
    public void buildTransportationOfDay(Cyxt cyxt, int year, int month, List<Map<String, Object>> dataList, List list, NumberFormat nf) {
        int days = getDays(year, month);
        Object yearsum = dataList.get(month - 1).get("YEARSUM");
        double yearsumd = Double.parseDouble(yearsum.toString());
        double monthavg = yearsumd / days * 10000;
        String format = nf.format(monthavg);
        format = format.replace("", " ").trim();
        cyxt.setDataItem1(format);
        String yjhy = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(yjhy);
    }

    /**
     * Methad info:------货物吞吐量圈图
     *
     * @author 陈兆庆
     * @date 2022/1/6 11:09
     */
    public void buildPortCargo(Cyxt cyxt, int month, List<Map<String, Object>> dataList, List list) {
        ArrayList<Integer> cargoList = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            Object monthsym = dataList.get(i).get("MONTHSUM");
            int data = (int) (Double.parseDouble(monthsym.toString()) * 10000);
            cargoList.add(data);
        }
        cyxt.setDataItem1(cargoList.toString().replace(" ", ""));
        cyxt.setDataItem2(getMonth2(month).toString().replace(" ", ""));
        String yjhy = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(yjhy);

    }

    /**
     * Methad info:------四种方式【货运】（折线图）
     *
     * @author 陈兆庆
     * @date 2022/1/6 13:47
     */
    public void buildFreightChart(Cyxt cyxt, int month, List<Map<String, Object>> roadTransportList, List<Map<String, Object>> waterWayFreightList, List<Map<String, Object>> railwayList, List<Map<String, Object>> airList, List list) {
        cyxt.setDataItem1(getMonth2(month).toString().replace(" ", ""));
        //--公路折线图
        cyxt.setDataItem2(buildFreightData(month, roadTransportList).toString().replace(" ", ""));
        //--水路折线图
        cyxt.setDataItem3(buildFreightData(month, waterWayFreightList).toString().replace(" ", ""));
        //--铁路折线图
        cyxt.setDataItem4(buildFreightData(month, railwayList).toString().replace(" ", ""));
        //--铁路折线图
        cyxt.setDataItem5(buildFreightData(month, airList).toString().replace(" ", ""));
        String datastr = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(datastr);
    }

    /**
     * Methad info:-------四种方式【客运】（折线图）
     *
     * @author 陈兆庆
     * @date 2022/1/6 14:03
     */
    public void buildPassengerTransport(Cyxt cyxt, int month, List<Map<String, Object>> highwayList, List<Map<String, Object>> waterWayList, List<Map<String, Object>> railWayList, List<Map<String, Object>> aviationList, List list) {
        cyxt.setDataItem1(getMonth2(month).toString().replace(" ", ""));
        //--公路折线图
        cyxt.setDataItem2(buildFreightData(month, highwayList).toString().replace(" ", ""));
        //--水路折线图
        cyxt.setDataItem3(buildFreightData(month, waterWayList).toString().replace(" ", ""));
        //--铁路折线图
        cyxt.setDataItem4(buildFreightData(month, railWayList).toString().replace(" ", ""));
        //--铁路折线图
        cyxt.setDataItem5(buildFreightData(month, aviationList).toString().replace(" ", ""));
        String datastr = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(datastr);

    }

    /**
     * Methad info:四种方式【货运】【客运】（折线图）通用方法
     *
     * @author 陈兆庆
     * @date 2022/1/6 13:54
     */
    public List buildFreightData(int month, List<Map<String, Object>> dataList) {
        ArrayList<Integer> freightList = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            Object monthsym = dataList.get(i).get("MONTHSUM");
            int data = (int) (Double.parseDouble(monthsym.toString()) * 10000);
            freightList.add(data);
        }
        return freightList;
    }

    //客运机场吞吐量
    public List<String> buildAirPortData() {
        Calendar cal = Calendar.getInstance();
        NumberFormat nf = NumberFormat.getInstance();
        nf.setMaximumFractionDigits(0);//保留0位
        //获得当前月份
        int month = new Date().getMonth();
        month = 11;//因目前1月份数据库未产生12月份数据，此此先模拟
        //获得当前年份
        int year = cal.get(Calendar.YEAR);
        ArrayList<String> list = new ArrayList<>();//用来存储所有的最终的json
        //初始化虹桥机场吞吐量量的list
        List<Map<String, Object>> hongqiaoList = initHongQiaoAirport();
        //初始化浦东机场吞吐量量的list
        List<Map<String, Object>> pudongList = initPudongAirport();


        Cyxt cyxt = buildgeneralpParame("8fdb63d797524b6baa86d7b796180c64", "kyLazy", "myChart18");
        buildairPortData(cyxt, month, hongqiaoList, pudongList, list);
        return list;

    }

    /**
     * Methad info:机场吞吐量
     *
     * @author 陈兆庆
     * @date 2022/1/6 14:38
     */

    public void buildairPortData(Cyxt cyxt, int month, List<Map<String, Object>> hongqiaoList, List<Map<String, Object>> pudongList, List list) {
        ArrayList<String> airList = new ArrayList<>();
        for (int i = 0; i < month; i++) {
            Object monthsumhq = hongqiaoList.get(i).get("MONTHSUM");
            int hongqiaoData = (int) (Double.parseDouble(monthsumhq.toString()) * 10000);
            Object monthsumpd = pudongList.get(i).get("MONTHSUM");
            int pudongData = (int) (Double.parseDouble(monthsumpd.toString()) * 10000);
            if (i == 0) {
                airList.add("{direction: '一月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 1) {
                airList.add("{direction: '二月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 2) {
                airList.add("{direction: '三月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 3) {
                airList.add("{direction: '四月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 4) {
                airList.add("{direction: '五月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 5) {
                airList.add("{direction: '六月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 6) {
                airList.add("{direction: '七月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 7) {
                airList.add("{direction: '八月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 8) {
                airList.add("{direction: '九月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 9) {
                airList.add("{direction: '十月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 10) {
                airList.add("{direction: '十一月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            } else if (i == 11) {
                airList.add("{direction: '十二月', '虹桥机场吞吐量(人次)': " + hongqiaoData + ",'浦东机场吞吐量(人次)': " + pudongData + "}");
            }
        }
        cyxt.setDataItem1(airList.toString());
        cyxt.setDataItem2("['direction', '虹桥机场吞吐量(人次)','浦东机场吞吐量(人次)']");
        String yjhy = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(yjhy);
    }

    //巡游车网约车
    public List<String> buildNetCar() {
        Calendar cal = Calendar.getInstance();
        DecimalFormat df = new DecimalFormat("0.00");
        NumberFormat nf = NumberFormat.getInstance();
        nf.setMaximumFractionDigits(0);//保留0位
        ArrayList<String> list = new ArrayList<>();//用来存储所有的最终的json
        //获得当前月份
        int month = new Date().getMonth();
        month = 11;//因目前1月份数据库未产生12月份数据，此此先模拟
        //获得当前年份
        int year = cal.get(Calendar.YEAR);
        year = 2021;

        int totalMonad = 0;//用来统计出租车的总单量
        long totalkm = 0;//用来统计出租车的月总公里


        //---每车日均订单（单）
        Object carAvg = initCarAvg();
        //统计每辆车的总营收
        List<Map<String, Object>> moneyList = initTotalMoney();
        //每单载客里程
        Object data = initSingleData();
        //每单载客时长
        Object orderTime = initPassengerTimeFororder();
        //每单营收
        Object money = initMoneyForOrder();
        //每车日均载客时长（分）
        Object kmOfPassengers = initKiloMeterForCarryPassengers();
        //每笔订单营收分布
        List<Map<String, Object>> orderList = initRevenueDistributionOforder();
        //【巡游车】每车日均营收分布
        List<Map<String, Object>> carMoneyList = initDistributionOfCar();
        //巡游车日均成距分布
        List<Map<String, Object>> distanceList = initDistributionOfDistance();
        //出租车总量
        Object taxiOrder = buildtaxi();
        //--【巡游车】企业日均订单TOP10
        List<Map<String, Object>> taxiTopTen = initTaxiTopTen();
        //网约车日均订单
        Object netcarOrder = buildNetcarOrder();
        //网约车每单载客里程（公里）
        Object netCardis = buildNetcarOrderOfdis();
        //网约车--每单载客时长（分）
        Object netCarTime = buildNetcarOrderOfTime();
        //网约车每单营收
        Object netCarRich = buildNetcarOrderOfRich();
        //网约车每车日均载客里程（公里）
        Object netcardisOfDay = buildNetcardisOfDay();
        //网约车--每车日均载客时长
        Object worktime = buildNetcarWorktime();
        //网约车订单日均分布
        List<Map<String, Object>> distributionOrderList = initDistributionOfOrders();

        //每车日均订单
        Cyxt cyxt1 = buildgeneralpParame("be6b6c098d0e4707a4a65df460adef11", "gtjtLazy", "xmcrjdd");
        buildPassengermileage(cyxt1, carAvg, list, df);

        //每单载客公里数(公里)
        Cyxt cyxt2 = buildgeneralpParame("9f1f20aad37c43789cf3449dcf5e9717", "gtjtLazy", "xmdzklc");
        buildPassengermileage(cyxt2, data, list, df);

        //--每单载客时长（分）
        Cyxt cyxt3 = buildgeneralpParame("f9bd5a7d85654dd4b581e61f814f7b6c", "gtjtLazy", "xmdzksc");
        buildPassengermileage(cyxt3, orderTime, list, df);

        //--每单营收（元）
        Cyxt cyxt4 = buildgeneralpParame("072deda380df4a28b674692d89a1ddcd", "gtjtLazy", "xmdys");
        buildPassengermileage(cyxt4, money, list, df);


        //--每车日均载客里程（公里）
        Cyxt cyxt5 = buildgeneralpParame("d7546cb9cd074517ac4a5ddb4d1febac", "gtjtLazy", "xmcrjzklc");
        buildPassengermileage(cyxt5, data, list, df);
        //--每车日均载客时长（分）
        Cyxt cyxt6 = buildgeneralpParame("1ae3492b302049aeb7e64270b231c22e", "gtjtLazy", "xmcrjzksc");
        buildPassengermileage(cyxt6, kmOfPassengers, list, df);
        //每笔订单营收分布
        Cyxt cyxt7 = buildgeneralpParame("8fed443e0a1e43aba0a5659208b54977", "gtjtLazy", "myChart25");
        buildRevenueDistributionOforder(cyxt7, list, orderList);


        //每车日均营收分布
        Cyxt cyxt8 = buildgeneralpParame("b1e799ee5ba8489ebc76afb43190dade", "gtjtLazy", "myChart22");
        buildDistributionOfCar(cyxt8, list, carMoneyList);

        //日均乘距分布(公里)
        Cyxt cyxt9 = buildgeneralpParame("938c45f4508545da8f2c9c4e5b63c28c", "gtjtLazy", "myChart2");
        buildDistanceOfCar(cyxt9, list, distanceList);
        //--【巡游车】企业日均订单TOP10
        Cyxt cyxt10 = buildgeneralpParame("cac8a92992ac4505b5e3fa9e17d6328e", "gtjtLazy", "myChart4");
        buildTopTen(cyxt10, taxiTopTen, list);
        //网约车日均订单
        Cyxt cyxt11 = buildgeneralpParame("0c72cc09630b46a2a671bdd2cdc5eb38", "gtjtLazy", "wmcrjdd");
        buildPassengermileage(cyxt11, netcarOrder, list, df);
        //网约车每单载客里程（公里）
        Cyxt cyxt12 = buildgeneralpParame("0cc6aed5f72046c893bf78b7d934324e", "gtjtLazy", "wmdzklc");
        buildPassengermileage(cyxt12, netCardis, list, df);
        //网约车每单载客时长（分）
        Cyxt cyxt13 = buildgeneralpParame("b30612d4d41240f3a85bbe3a34333b60", "gtjtLazy", "wmdzksc");
        buildPassengermileage(cyxt13, netCarTime, list, df);
        //网约车每单营收（元）
        Cyxt cyxt14 = buildgeneralpParame("076a85b3e246485895e5b213d1fbe8b9", "gtjtLazy", "wmdys");
        buildPassengermileage(cyxt14, netCarRich, list, df);
        //网约车每车日均载客里程（公里）
        Cyxt cyxt15 = buildgeneralpParame("8e10f63ca6fc4aafaee0936514bc870c", "gtjtLazy", "wmcrjzklc");
        buildPassengermileage(cyxt15, netcardisOfDay, list, df);
        //--每车日均载客时长（分
        Cyxt cyxt16 = buildgeneralpParame("1e024ed3acb744688237807c4326be24", "gtjtLazy", "wmcrjzksc");
        buildPassengermileage(cyxt16, worktime, list, df);
        //-------订单日均分布
        Cyxt cyxt17 = buildgeneralpParame("f0ce478abead49bd9507d6d6023d9fc6", "gtjtLazy", "myChart9");
        buildAveragedailyDistributionOfOrders(cyxt17, distributionOrderList, list);

        return list;
    }


    /**
     * Methad info:--每单载客里程（公里）
     *
     * @author 陈兆庆
     * @date 2022/1/6 18:28
     */

    public void buildPassengermileage(Cyxt cyxt, Object data, List list, DecimalFormat df) {
        cyxt.setDataItem1(df.format(Float.parseFloat(data.toString())));
        String datastr = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(datastr);
    }


    /**
     * Methad info:每笔订单营收分布
     *
     * @author 陈兆庆
     * @date 2022/1/10 10:22
     */
    public void buildRevenueDistributionOforder(Cyxt cyxt, List list, List<Map<String, Object>> orderMaps) {
        String value1 = null;//15元及以下
        String value2 = null;//15-30元
        String value3 = null;//30-50元
        String value4 = null;//50-100元
        String value5 = null;//100元以上

        for (Map<String, Object> entry : orderMaps) {
            if (entry.get("TYPE").equals("150")) {
                value1 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("150300")) {
                value2 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("300500")) {
                value3 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("5001000")) {
                value4 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            }
        }
        value5 = String.format("%.2f", 100 - Double.valueOf(value1) - Double.valueOf(value2) - Double.valueOf(value3) - Double.valueOf(value4));
        cyxt.setDataItem1("[{value:" + value1 + ",name:'15元及以下'},{value:" + value2 + ",name:'15-30元'},{value:" + value3 + ",name:'30-50元'},{value:" + value4 + ",name:'50-100元'},{value:" + value5 + ",name:'100元以上'}]");
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
    }

    /**
     * Methad info: 每车日均营收分布
     *
     * @author 陈兆庆
     * @date 2022/1/10 11:04
     */
    public void buildDistributionOfCar(Cyxt cyxt, List list, List<Map<String, Object>> orderMaps) {
        String value1 = null;//100元及以下
        String value2 = null;//100-200元
        String value3 = null;//200-500元
        String value4 = null;//500-1000元
        String value5 = null;//1000元以上
        for (Map<String, Object> entry : orderMaps) {
            if (entry.get("TYPE").equals("100")) {
                value1 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("100200")) {
                value2 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("200500")) {
                value3 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("5001000")) {
                value4 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            }
        }
        value5 = String.format("%.2f", 100 - Double.valueOf(value1) - Double.valueOf(value2) - Double.valueOf(value3) - Double.valueOf(value4));
        cyxt.setDataItem1("[{value:" + value1 + ",name:'100元及以下'},{value:" + value2 + ",name:'100-200元'},{value:" + value3 + ",name:'200-500元'},{value:" + value4 + ",name:'500-1000元'},{value:" + value5 + ",name:'1000元以上'}]");
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
    }

    /**
     * Methad info:日均成距分布
     *
     * @author 陈兆庆
     * @date 2022/1/10 11:38
     */
    public void buildDistanceOfCar(Cyxt cyxt, List list, List<Map<String, Object>> orderMaps) {
        String value1 = null;//0-3公里及以下
        String value2 = null;//3-5公里及以下
        String value3 = null;//5-7公里及以下
        String value4 = null;//7-10公里及以下
        String value5 = null;//10-15公里及以下
        String value6 = null;//15-20公里及以下
        String value7 = null;//20-30公里及以下
        String value8 = null;//30-40公里及以下
        String value9 = null;//40-70公里及以下
        String value10 = null;//70公里以上
        for (Map<String, Object> entry : orderMaps) {
            if (entry.get("TYPE").equals("3")) {
                value1 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("35")) {
                value2 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("57")) {
                value3 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("710")) {
                value4 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("1015")) {
                value5 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("1520")) {
                value6 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("2030")) {
                value7 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("3040")) {
                value8 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            } else if (entry.get("TYPE").equals("4070")) {
                value9 = String.format("%.2f", Double.valueOf(entry.get("V").toString()));
            }
        }
        value10 = String.format("%.2f", 100 - Double.valueOf(value1) - Double.valueOf(value2) - Double.valueOf(value3) - Double.valueOf(value4) - Double.valueOf(value5) - Double.valueOf(value6) - Double.valueOf(value7) - Double.valueOf(value8) - Double.valueOf(value9));
        cyxt.setDataItem1("['0-3','3-5','5-7','7-10','10-15','15-20','20-30','30-40','40-70','>70']");
        cyxt.setDataItem2("[" + value1 + "," + value2 + "," + value3 + "," + value4 + "," + value5 + "," + value6 + "," + value7 + "," + value8 + "," + value9 + "," + value10 + "]");
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
    }

    /**
     * Methad info:--【巡游车】企业日均订单TOP10
     *
     * @author 陈兆庆
     * @date 2022/1/10 12:31
     */

    public void buildTopTen(Cyxt cyxt, List<Map<String, Object>> taxiTopTen, List list) {
        List<String> dataList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            Map<String, Object> map = taxiTopTen.get(i);
            if (map.get("YHMC").toString().substring(1, 5).equals("0335")) {
                dataList.add("'大众交通'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0216")) {
                dataList.add("'上海强生'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0209")) {
                dataList.add("'上海海博'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0407")) {
                dataList.add("'上海锦江'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0057")) {
                dataList.add("'宝山海博'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0805")) {
                dataList.add("'衡山汽车'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0010")) {
                dataList.add("'日升出租'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0205")) {
                dataList.add("'迎宾出租'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0058")) {
                dataList.add("'奉贤汽车'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0054")) {
                dataList.add("'青浦海博'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("1416")) {
                dataList.add("'上海旗忠'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0120")) {
                dataList.add("'上海建工'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("0023")) {
                dataList.add("'上海振星'");
            } else if (map.get("YHMC").toString().substring(1, 5).equals("4009")) {
                dataList.add("'上海振东'");
            }
        }
        Object buildtaxi = buildtaxi();//运输总量
        int total = (int) (Double.valueOf(buildtaxi.toString()) * 10000);
        cyxt.setDataItem1(dataList.toString().replace(" ", ""));
        ArrayList<Integer> list1 = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            Map<String, Object> map = taxiTopTen.get(i);
            Object number = map.get("A.C||'%'");
            double num1 = Double.valueOf(number.toString().substring(0, number.toString().length() - 1)) / 100;
            int num3 = (int) (num1 * total);
            list1.add(num3);
        }
        cyxt.setDataItem2(list1.toString().replace(" ", ""));
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);

    }

    /**
     * Methad info:-------订单日均分布
     *
     * @author 陈兆庆
     * @date 2022/1/10 15:44
     */
    public void buildAveragedailyDistributionOfOrders(Cyxt cyxt, List<Map<String, Object>> distributionOrderList, List list) {
        List<String> dataList = new ArrayList<>();
        ArrayList<String> list1 = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            Map<String, Object> map = distributionOrderList.get(i);
            if (map.get("COMPANYID").toString().equals("didi")) {
                dataList.add("'滴滴'");
            } else if (map.get("COMPANYID").toString().equals("meituan")) {
                dataList.add("'路团'");
            } else if (map.get("COMPANYID").toString().substring(1, 5).equals("3201NJLXPJXB")) {
                dataList.add("'领行'");
            } else if (map.get("COMPANYID").toString().equals("3100SKCX7762")) {
                dataList.add("'赛可'");
            } else if (map.get("COMPANYID").toString().equals("3100SMLYMM4J")) {
                dataList.add("'申茂'");
            } else if (map.get("COMPANYID").toString().equals("3301YXKJ223E")) {
                dataList.add("'优行'");
            } else if (map.get("COMPANYID").toString().equals("shouyue")) {
                dataList.add("'首约'");
            } else if (map.get("COMPANYID").toString().equals("shenzhou")) {
                dataList.add("'神舟'");
            } else if (map.get("COMPANYID").toString().equals("3502FZXTRM1E")) {
                dataList.add("'方舟'");
            } else if (map.get("COMPANYID").toString().equals("3301TMCX463C")) {
                dataList.add("'添猫'");
            } else if (map.get("COMPANYID").toString().equals("yangguangchedao")) {
                dataList.add("'阳光环球'");
            } else if (map.get("COMPANYID").toString().equals("1200HTCYEH7R")) {
                dataList.add("'海豚出游'");
            } else if (map.get("COMPANYID").toString().equals("4201BMKP074X")) {
                dataList.add("'阳光环球'");
            } else if (map.get("COMPANYID").toString().equals("yangguangchedao")) {
                dataList.add("'斑马快跑'");
            } else if (map.get("COMPANYID").toString().equals("1101FDZH891N")) {
                dataList.add("'飞嘀智慧'");
            } else if (map.get("COMPANYID").toString().equals("jbyy")) {
                dataList.add("'久柏'");
            } else if (map.get("COMPANYID").toString().equals("yuedao")) {
                dataList.add("'美跃'");
            } else if (map.get("COMPANYID").toString().equals("2201JQCXH93U")) {
                dataList.add("'吉汽'");
            }
        }
        cyxt.setDataItem1(dataList.toString().replace(" ", ""));
        for (int i = 0; i < 10; i++) {
            Object data = distributionOrderList.get(i).get("C");
            list1.add(data.toString());
        }
        cyxt.setDataItem2(list1.toString().replace(" ", ""));
        String data = JSONObject.toJSONString(cyxt, SerializerFeature.WriteMapNullValue);
        list.add(data);
    }


    @Transactional
    public String buildTotal() {
        long start = System.currentTimeMillis();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            log.info("城运系统页面数据开始生成{}", sdf.format(new Date()));
            List<String> freightList = buildFreightData();
            List<String> passengerTransportList = buildPassengerTransport();
            List<String> homeScreenlist = buildHomeScreen();
            List<String> airPortlist = buildAirPortData();
            List<String> netCatlist = buildNetCar();
            ArrayList<String> totalList = new ArrayList<>();
            totalList.addAll(freightList);
            totalList.addAll(passengerTransportList);
            totalList.addAll(homeScreenlist);
            totalList.addAll(airPortlist);
            totalList.addAll(netCatlist);
            long end = System.currentTimeMillis();
            log.info("城运系统页面数据生成结束,执行时间{}毫秒", end - start);
            return totalList.toString();
        } catch (Exception e) {
            log.error("城运系统页面数据生成异常....", e);
        }
        return null;
    }

    /**
     * Methad info:计算今年月份截止天数
     *
     * @author 陈兆庆
     * @date 2022/1/5 17:22
     */
    public int getDays(int year, int month) {
        int days = 0;
        for (int i = 0; i < month; i++) {
            if (i == 0 || i == 2 || i == 4 || i == 6 || i == 7 || i == 9 || i == 11) {
                days += 31;
            } else if (i == 3 || i == 5 || i == 8 || i == 10) {
                days += 30;
            } else {
                if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
                    days += 29;
                } else {
                    days += 29;
                }
            }
        }
        return days;
    }


    /**
     * Methad info:计算上年月份截止天数
     *
     * @author 陈兆庆
     * @date 2022/1/5 17:22
     */
    public int getlastYearDays(int year, int month) {
        int days = 0;
        for (int i = 0; i < month; i++) {
            if (i == 0 || i == 2 || i == 4 || i == 6 || i == 7 || i == 9 || i == 11) {
                days += 31;
            } else if (i == 3 || i == 5 || i == 8 || i == 10) {
                days += 30;
            } else {
                if ((year - 1) % 4 == 0 && (year - 1) % 100 != 0 || (year - 1) % 400 == 0) {
                    days += 29;
                } else {
                    days += 29;
                }
            }
        }
        return days;
    }


    /**
     * Methad info:通用的参数
     *
     * @return com.wonders.cyxtjsonupdate.entity.Cyxt
     * @author 陈兆庆
     * @date 2022/1/4 14:47
     */
    public Cyxt buildgeneralpParame(String id, String mainType, String subType) {
        Cyxt cyxt = new Cyxt();
        cyxt.setId(id);
        cyxt.setMainType(mainType);
        cyxt.setSubType(subType);
        return cyxt;
    }

    /**
     * Methad info:拼接月份
     *
     * @author 陈兆庆
     * @date 2022/1/4 16:14
     */
    public List buildMonth(int month) {
        ArrayList<String> monthList = new ArrayList<>();
        //拼接月份
        for (int i = 0; i < month; i++) {
            if (i == 0) {
                monthList.add("'1月'");
            } else if (i == 1) {
                monthList.add("'2月'");
            } else if (i == 2) {
                monthList.add("'3月'");
            } else if (i == 3) {
                monthList.add("'4月'");
            } else if (i == 4) {
                monthList.add("'5月'");
            } else if (i == 5) {
                monthList.add("'6月'");
            } else if (i == 6) {
                monthList.add("'7月'");
            } else if (i == 7) {
                monthList.add("'8月'");
            } else if (i == 8) {
                monthList.add("'9月'");
            } else if (i == 9) {
                monthList.add("'10月'");
            } else if (i == 10) {
                monthList.add("'11月'");
            } else if (i == 11) {
                monthList.add("'12月'");
            }
        }
        return monthList;
    }


    /**
     * Methad info:拼接月份
     *
     * @author 陈兆庆
     * @date 2022/1/12 11:16
     */

    public List getMonth2(int month) {
        //拼接月份的集合
        ArrayList<String> monthList = new ArrayList<>();
        //拼接月份
        for (int i = 0; i < month; i++) {
            if (i == 0) {
                monthList.add("'一月'");
            } else if (i == 1) {
                monthList.add("'二月'");
            } else if (i == 2) {
                monthList.add("'三月'");
            } else if (i == 3) {
                monthList.add("'四月'");
            } else if (i == 4) {
                monthList.add("'五月'");
            } else if (i == 5) {
                monthList.add("'六月'");
            } else if (i == 6) {
                monthList.add("'七月'");
            } else if (i == 7) {
                monthList.add("'八月'");
            } else if (i == 8) {
                monthList.add("'九月'");
            } else if (i == 9) {
                monthList.add("'十月'");
            } else if (i == 10) {
                monthList.add("'十一月'");
            } else if (i == 11) {
                monthList.add("'十二月'");
            }
        }
        return monthList;
    }

}
